sortByDimnames: Sort matrix by dim names

Description Usage Arguments Value Author(s) Examples

View source: R/dfmat.R

Description

Rearrange rows and columns of a matrix by dim names

Usage

1
sortByDimnames(x, row.decreasing = FALSE, col.decreasing = FALSE)

Arguments

x

A matrix or data.frame

row.decreasing

Logical, whether rows should be sorted decreasingly

col.decreasing

Logical, whether columns should be sorted decreasingly

Value

Resorted matrix or data frame

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

Examples

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)

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.