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 reversing r doesn't work but in small examples.

Thanks,
-Jose




______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to