RANK: Produces ranks of entries of vector

View source: R/RANK.R

RANKR Documentation

Produces ranks of entries of vector

Description

An alternative to the function rank (which replaces ties by average rank). This function instead gives each tied value the same rank. The output will have the same length as x but contain integer values from 1 to length(unique(x)).

Usage

RANK(x)

Arguments

x

a numeric vector

Value

Vector of integer ranks of the same length as x.

Author(s)

Chris J. Lloyd

Examples

x=c(5,4,4,7,6)
rank(x)
# 3.0 1.5 1.5 5.0 4.0
RANK(x)
# 2 1 1 4 3

CLAST documentation built on April 8, 2022, 9:06 a.m.