Description Usage Arguments Value
When you subset a matrix or data frame and the condition ends up only grabbing one row, R returns a vector instead of a matrix with one row. This function returns a matrix with one row.
1 |
x |
the matrix or data frame to subset |
rows |
either a vector of row indicies or a logical vector giving which rows to select from |
cols |
either a vector of column indicies or a logical vector giving which rows to select from |
a matrix subsetted to include only the rows and columns indicated but with its dimensionality preserved.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.