dimnames | R Documentation |
Set matrix row or column names without copying, especially useful for (very) large matrices.
setColnames(matrix, colnames)
setRownames(matrix, rownames)
setDimnames(matrix, nameslist)
matrix |
An R matrix |
colnames |
Character vector of column names |
rownames |
Character vector of row names |
nameslist |
A two-component list containing rownames and colnames |
Adrian Dusa
mat <- matrix(1:9, nrow = 3)
setDimnames(mat, list(LETTERS[1:3], letters[1:3]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.