sortRows: sortRows

View source: R/misc.R

sortRowsR Documentation

sortRows

Description

sortRows

Usage

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.

toporder

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

na.rm

Whether to remove missing values and invariant rows.

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

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


plger/sechm documentation built on Oct. 25, 2024, 8:22 p.m.