Description Usage Arguments Author(s) Examples
Change rownames or colnames of a matrix/dataframe based on another matrix/dataframe
1 | change_names(rowOrCol, Table, nameForTable)
|
rowOrCol |
Give "row" or "col" as input to decide where row names or column names are to be changed |
Table |
The table in which the row or column names are to be changed |
nameForTable |
A 2 column matrix/dataframe: 1st column/row: original names; 2nd column/row: new names |
Peter I-Fan Wu
1 2 3 4 5 | mat=matrix(c(1:12),nrow=3)
rownames(mat)=c("1","2","3")
new_row_names=c("one","two","three")
change_names(rowOrCol="row", mat, data.frame(original=rownames(mat), new=new_col_names))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.