indexMatrix | R Documentation |
Convenience function for selecting multiple elements from a matrix by rows and columns position
indexMatrix(rows, cols, mat, returnIndex = FALSE)
rows |
row coordinate of matrix |
cols |
col coorinate of matrix |
mat |
Matrix of interest |
returnIndex |
If TRUE return the one dimensional index for the items otherwise return the selected elements of the matrix |
A vector of indices if returnIndex is TRUE or a vector of the selected matrix elements
indexMatrix(c(1,2,3),c(1,2,1),matrix(1:9,nrow=3,byrow=TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.