Skip to contents

Mirrors the C# Statistics.RanksInPlace(double[]): tied values (exact equality) receive the average rank of their run.

Usage

ranks(x)

Arguments

x

numeric vector.

Value

a numeric vector of ranks, same length and order as x.

Examples

ranks(c(3, 1, 2, 1))
#> [1] 4.0 1.5 3.0 1.5