From ripley at stats.ox.ac.uk  Thu Oct 21 08:30:45 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu Oct 21 08:31:00 2004
Subject: [Rd] documentation for rank() (PR#7298)
In-Reply-To: <Pine.LNX.4.58.0410202217460.26924@bear.fhcrc.org>
Message-ID: <Pine.LNX.4.44.0410210724500.24759-100000@gannet.stats>

On Wed, 20 Oct 2004, Douglas Grove wrote:

> Oh crap.  So sorry.  This is my fault (obviously).
> Prior to the new ties methods being added in 2.0.0
> I modified the source to do this myself.  So looks
> like I forgot: (1) that my modified code was still
> being accessed default (thought I'd removed it) and
> (2) that I had added in the 'decreasing' argument.
> 
> It did seem very odd to me when I saw the undocumented
> argument.
> 
> Sorry for the this faulty bug report.
> 
> BTW, would someone please add a 'decreasing' argument to rank.
> It seems natural to have one, just like sort, and only
> involves about two lines of code and a few lines of
> editing to the help file. 

I don't think so.  At the very least, each tie method needs a change, as 
may the handling of NAs.  Also the writing a comprehensible help page will 
become very complex.

What is the need?  Rank works for numeric vectors, and why can't you just
call rank(-x) or n+1-rank(x)?  The reason that does not work for sort() is
that it deals with non-numeric vectors.

Incidentally, we might need a `last' value for ties.method.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] documentation for rank() (PR#7298)
Prof Brian Ripley