submatrix | R Documentation |
Submatrix of a matrix returning ALWAYS a matrix
submatrix(M, rows = 1:nrow(M), cols = 1:ncol(M))
M |
matrix |
rows |
Index vector |
cols |
Index vector |
The matrix M[rows, cols]
, keeping/adjusting attributes like ncol nrow and dimnames.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.