reorder_mat | R Documentation |
Takes a matrix and re-orders the rows and columns to some target ordering
reorder_mat(matrix, names)
matrix |
input matrix to be re-arranged. Must have rows and columns named |
names |
character vector containing the dimension names of the input matrix in the desired ordering |
input matrix with rows and columns sorted according to names
order_gen
, network_to_SEset
data(riskcor) # first define an ordered vector of names row_names <- rownames(riskcor) row_names_new <- row_names[c(1,2,3,4,6,5)] reorder_mat(riskcor,row_names_new) # The fifth and sixth row and column have been switched print(riskcor)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.