Description Usage Arguments Details Value Examples
Function for ranking vector after rounding.
1 2 | round_rank(x, type = "desc", na.last = TRUE, ties = c("average", "first",
"last", "random", "max", "min"), round_digits = 7)
|
x |
A numeric, complex, character or logical vector. |
type |
Type of ranking: |
na.last |
For controlling the treatment of |
ties |
A character string specifying how ties are treated (see Details). Can be abbreviated. |
round_digits |
Value of |
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.
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).
1 2 3 4 5 6 | round_rank(10:1, type = "desc")
round_rank(10:1, type = "asc")
set.seed(334)
x <- 10^(-10) * runif(10)
round_rank(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.