fastrank: Rank vectors with low overhead

Description Usage Arguments Value Note References See Also

Description

An R function providing fast ranking vectors, as an alternative to calling .Internal(rank(...)), which packages cannot do. This entry is as general as it can be, but so far there is still a bit of overhead in calling this method. If you really want the fastest interface, try using one of the other entry points (e.g., fastrank_numeric_average) or (if you are not writing package code) call the C function directly.

Usage

1
fastrank(x, ties.method = "average", sort.method = 5L)

Arguments

x

A vector of values to rank. Note that character vectors are not accepted, as the internal R routines for comparing characters as R does are not part of the R API. Please use rank from base R to rank character vectors.

ties.method

Method for resolving rank ties in x, all in rank are available

x

Vector to calculate ranks for

find

Method for finding ties.method, either 1 or 2

Value

A vector of ranks of values in x, with length the same as length(x). Ranks of tied values are handled according to ties.method, see rank. When ties.method is "average", a numeric vector is returned, otherwise an integer vector is returned.

Note

The vector must not include NAs or NaNs. This is **not** checked.

The vector must also not be of type character.

References

https://github.com/douglasgscofield/fastrank

See Also

rank


douglasgscofield/fastrank documentation built on May 15, 2019, 10:43 a.m.