Learn R Programming

matrixStats (version 0.5.2)

rowRanks: Gets the rank of each row (column) of a matrix

Description

Gets the rank of each row (column) of a matrix.

Usage

rowRanks(x, ...)
 colRanks(x, ...)

Arguments

...
Not used.

Value

Missing and non- values

These are ranked as NA, as with na.last="keep" in the rank() function.

Ties

Ties are ranked equally, as with setting ties.method="max" in the rank() function.

Details

The row- (column-) ranks of x are collected as rows of the result matrix. The implementation is optimized for both speed and memory. To avoid coercing to doubles (and hence memory allocation), there is a unique implementation for integer matrices. Currently, colRanks(x) is just rowRanks(t(x)). Any names of x are ignored and absent in the result.

See Also

rank(). For developers, see also Section 'Utility functions' in 'Writing R Extensions manual', particularly the native functions R_qsort_I() and R_qsort_int_I().