rank {base} | R Documentation |
rank
returns the sample ranks of the values in x
.
Ties result in ranks being averaged.
NA
values are not allowed in this function.
rank(x)
(r1 <- rank(x1 <- c(3,1,4,59,26))) (r2 <- rank(x2 <- c(3,1,4,5,9,2,6,5,3,5))) # ties ## rank() is "idempotent": rank(rank(x)) == rank(x) : stopifnot(rank(r1) == r1, rank(r2) == r2)