From ggrothendieck at myway.com  Sat Jun 26 05:25:31 2004
From: ggrothendieck at myway.com (Gabor Grothendieck)
Date: Sat Jun 26 05:40:24 2004
Subject: [Rd] Suggestion: ties.method = "last" in rank
Message-ID: <loom.20040626T052358-266@post.gmane.org>


An earlier post shown at the bottom of:

https://www.stat.math.ethz.ch/pipermail/r-help/2004-June/051975.html

asked for a ranking in which the highest rank among ties
was to be used for all ties.  Note that if the lowest rank 
among ties had been required then this would have worked:

   rank(x, ties.method = "first")[match(rank(x),rank(x))]

and if tie="last" were available, the poster's question could have
had a similarly simple solution:

   rank(x, ties.method = "last")[match(rank(x),rank(x))] 

The existence of this question and symmetry suggests that ties.method="last"
should be made available too.  To do this, just add this to the switch
statement in rank:

   last = order(order(rev(x[!nas])), decreasing = TRUE)


[Rd] Suggestion: ties.method = "last" in rank
Gabor Grothendieck