powered by
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)).
RANK(x)
a numeric vector
Vector of integer ranks of the same length as x.
# NOT RUN { 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 # }
Run the code above in your browser using DataLab