RANK | R Documentation |
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)
x |
a numeric vector |
Vector of integer ranks of the same length as x.
Chris J. Lloyd
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.