The bounds of the percentile rank are > 0 and < 1 (see Boundaries)
A percentile rank here is the proportion of scores that are less than the current score.
Where
percentile_rank(x, weights = times, times)
The percentile rank of x
between 0 and 1 (see Boundaries)
A vector of values to rank
A vector of the number of times to repeat x
While the percentile rank of a score in a set must be exclusively within the
boundaries of 0
and 1
, this function may produce a percentile rank that
is exactly 0
or 1
. This may occur when the number of values are so large
that the value within the boundaries is too small to be differentiated.
Additionally, when using the weights
parameter, if the lowest or highest
number has a value of 0
, the number will then have a theoretical 0
or
1
, as these values are not actually within the set.
Computes a percentile rank for each score in a set.
percentile_rank(0:9)
x <- c(1, 2, 1, 7, 5, NA_integer_, 7, 10)
percentile_rank(x)
if (package_available("dplyr")) {
dplyr::percent_rank(x)
}
# with times
percentile_rank(7:1, c(1, 0, 2, 2, 3, 1, 1))
Run the code above in your browser using DataLab