On Wed, 1 Dec 2004, Jose Quesada wrote:
Is there any simple solution to get ranks in descending order?
Example,
a - c(10, 98, 98, 98, 99, 100)
r - rank(a, ties.method=average)
produces
1 3 3 3 5 6
I would want this instead:
6 5 3 3 3 1
What does that correspond to (why are 98 and 99 ranked the
Hi,
Is there any simple solution to get ranks in descending order?
Example,
a - c(10, 98, 98, 98, 99, 100)
r - rank(a, ties.method=average)
produces
1 3 3 3 5 6
I would want this instead:
6 5 3 3 3 1
Note that reversing r doesn't work but in small examples.
Thanks,
-Jose
--
[EMAIL
Try this:
r - sort(rank(a, ties.method=average), decreasing=T)
Jose Quesada wrote:
Hi,
Is there any simple solution to get ranks in descending order?
Example,
a - c(10, 98, 98, 98, 99, 100)
r - rank(a, ties.method=average)
produces
1 3 3 3 5 6
I would want this instead:
6 5 3 3 3 1
Note that