Auxiliary Function for Sorting and Ranking
A generic auxiliary function that produces a numeric vector which
will sort in the same order as
- an R object.
This is a special case of ranking, but as a less general function than
rank is more suitable to be made generic. The default
method is similar to
rank(x, ties.method = "min",
na.last = "keep"), so
NA values are given rank
NA and all
tied values are given equal integer rank.
The default method will unclass the object if
is.numeric(x) is true but otherwise make use of
> methods for the class of
i), and the
is.na method for the class of
x, but might be rather slow when doing so.
A numeric (usually integer) vector of the same length as