rankMulti: 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), ...)
Value
Numeric vector of ranks.
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 rank. Note that if the ties.method argument is used the options 'first' or 'random' will rank by the first column uniquely such that there are no ties for subsequent columns to break.