Description Usage Arguments Value Author(s) Examples
Rearrange rows and columns of a matrix by dim names
1 | sortByDimnames(x, row.decreasing = FALSE, col.decreasing = FALSE)
|
x |
A matrix or data.frame |
row.decreasing |
Logical, whether rows should be sorted decreasingly |
col.decreasing |
Logical, whether columns should be sorted decreasingly |
Resorted matrix or data frame
Jitao David Zhang <jitao_david.zhang@roche.com>
1 2 3 | testMat <- matrix(1:16, nrow=4, dimnames=list(c("B", "D", "A", "C"), c("t", "f", "a", "g")))
sortByDimnames(testMat)
sortByDimnames(testMat, row.decreasing=TRUE, col.decreasing=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.