[R] alternate rank method
sundar.dorai-raj at PDF.COM
Fri Jun 25 19:52:36 CEST 2004
Douglas Grove wrote:
> I'm wondering if anyone can point me to a function that will
> allow me to do a ranking that treats ties differently than
> rank() provides for?
> I'd like a method that will assign to the elements of each
> tie group the largest rank.
> An example:
> For the vector 'v', I'd like the method to return 'rv'
> v: 1 2 3 3 3 4 5 5 6 7
> rv: 1 2 5 5 5 6 8 8 9 10
> Doug Grove
rv <- rowSums(outer(v, v, ">="))
Adapted from Prof. Ripley's reply in the following thread:
More information about the R-help