powered by
subscript2d is for subscripting matrices and data frames.
subscript2d(x,i,j) subscript2dMatrix(x,i,j) subscript2dDataFrame(x,i,j)
subscript2d(x,i,j) is like x[i,j,drop=F], except that it allows x[,1] (for example) for atomic vectors as well, and it always returns an object of the same class as x
subscript2d(x,i,j)
x[i,j,drop=F]
x[,1]
x
(that is, it does not support a drop argument).
a matrix or data frame
first (row) subscript.
second (column) subscript.
as.data.frame, matrix.
as.data.frame
matrix
x <- 1:10 subscript2d(x,3,1) subscript2d(data.frame(x),3,1) subscript2d(matrix(x),3,1)
Run the code above in your browser using DataLab