Re: [R] rank in descending order?

2004-12-02 Thread Prof Brian Ripley
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

[R] rank in descending order?

2004-12-01 Thread Jose Quesada
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

Re: [R] rank in descending order?

2004-12-01 Thread Damián Cirelli
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