View source: R/misc_functions.R
pctl_rank | R Documentation |
'pctl_rank' calculates the percentile rank of a numeric vector
pctl_rank(
x,
ties.method = c("average", "first", "random", "max", "min", "dense")
)
x |
A numeric vector to rank |
ties.method |
A character string specifying how ties are treated |
The percentile rank of the `x`
vector calculated according to the ties.method choosen
library(data.table)
library(CKutils)
x = c(2,5,1,3,4,6)
pctl_rank(x, ties.method="min") # min assigns every tied element to the lowest rank
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.