round_rank(x, type = "desc", na.last = TRUE, ties = c("average", "first",
"last", "random", "max", "min"), round_digits = 7)
Arguments
x
A numeric, complex, character or logical vector.
type
Type of ranking: "desc" or "asc" (see Details).
na.last
For controlling the treatment of NAs. If TRUE, missing
values in the data are put last; if FALSE, they are put first; if NA,
they are removed; if "keep" they are kept with rank NA.
ties
A character string specifying how ties are treated (see Details).
Can be abbreviated.
A numeric vector of the same length as x with names copied from x
(unless na.last = NA, when missing values are removed). The vector is of
integer type unless x is a long vector or ties = "average" when it is of
double type (whether or not there are any ties).
Details
This is basically a wrapper around rank() in which x is
pre-modified by rounding to specific number of digits round_digits.
type can have two values: "desc" for ranking in descending order (rank 1
is given to the biggest value in x) and "asc" (rank 1 is given to the
smallest value in x). Any other value will cause error.