[Rd] rank() with decreasing argument - feature request

From: Adaikalavan Ramasamy <ramasamy_at_cancer.org.uk>
Date: Thu 22 Jul 2004 - 01:06:58 EST


I like to request that the an argument/option to rank numbers in decreasing order, i.e. largest number first, be added to rank(). Currently I am using the following construct, which can get a bit cumbersome at time.

> rank.decreasing <- function(x) length(x) + 1 - rank(x)
> x <- c(101, 103, 102)
> rank(x)

[1] 1 3 2
> rank.decreasing(x)

[1] 3 1 2

I hope this is not an unreasonable request considering sort() and order() have decreasing option. Thank you.

Regards, Adai



R-devel@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-devel Received on Thu Jul 22 01:11:30 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 08:59:12 EST