sortRows: sortRows

Description Usage Arguments Value Examples

View source: R/misc.R

Description

sortRows

Usage

1
2
3
4
5
6
7
8
sortRows(
  x,
  z = FALSE,
  toporder = NULL,
  na.rm = FALSE,
  method = "MDS_angle",
  toporder.meth = "before"
)

Arguments

x

A numeric matrix or data.frame.

z

Whether to scale rows for the purpose of calculating order (default FALSE).

toporder

Optional verctor of categories (length=nrow(x)) on which to supra-order when sorting rows.

na.rm

Wheter to remove missing values and invariant rows (default FALSE).

method

Seriation method; 'MDS_angle' (default) or 'R2E' recommended.

toporder.meth

Whether to perform higher-order sorting 'before' (default) or 'after' the lower-order sorting.

Value

A reordered matrix or data.frame.

Examples

1
2
3
4
5
# random data
m <- matrix( round(rnorm(100,mean=10, sd=2)), nrow=10,
             dimnames=list(LETTERS[1:10], letters[11:20]) )
m
sortRows(m)

SEtools documentation built on Nov. 8, 2020, 8:21 p.m.