pctl_rank: Calculate percentile rank

View source: R/misc_functions.R

pctl_rankR Documentation

Calculate percentile rank

Description

'pctl_rank' calculates the percentile rank of a numeric vector

Usage

pctl_rank(
  x,
  ties.method = c("average", "first", "random", "max", "min", "dense")
)

Arguments

x

A numeric vector to rank

ties.method

A character string specifying how ties are treated

Value

The percentile rank of the `x` vector calculated according to the ties.method choosen

Examples

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

ChristK/CKutils documentation built on April 11, 2025, 10:11 p.m.