Description Usage Arguments Value Examples
Function takes a vector containing names and a matrix and exchanges the rownames of the matrix with the ones provided in the names vector. Note that the row dimension of the matrix has to be equal to the length of the names vector. The function was written to enable a rownames replacement in dplyr's pipe.
1 | chg_rownames(matrix, newnames)
|
matrix |
any matrix of dimension n*m |
newnames |
a character vector of length n |
the given matrix with changed rownames
1 2 3 4 5 | ## Not run:
matrix %>%
chg_rownames(newnames)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.