rankMulti {statisfactory} | R Documentation |
A multivariate adaptation of the rank() function
Description
This function ranks values in a data frame or matrix by more than one field, with ties in one field broken by subsequent fields.
Usage
rankMulti(x, cols = 1:ncol(x), ...)
Arguments
x |
Data frame or matrix. |
cols |
Names or indices of columns by which to rank, with first one gaining preference over the second, second over the third, etc. |
... |
Arguments to pass to |
Value
Numeric vector of ranks.
Examples
x <- data.frame(x1=c('a', 'b', 'b', 'c', 'a', 'a'), x2=c(11, 2, 1, NA, 10, 11))
rankMulti(x)
rankMulti(x, c('x2', 'x1'))
[Package statisfactory version 1.0.4 Index]