From macrakis at alum.mit.edu  Thu Aug 20 23:51:01 2009
From: macrakis at alum.mit.edu (Stavros Macrakis)
Date: Thu, 20 Aug 2009 17:51:01 -0400
Subject: [Rd] Documentation of ties.method argument in `rank`
Message-ID: <8b356f880908201451m7700a7e0q65173508da0d7af3@mail.gmail.com>

In R 2.9.1/Windows, ? rank says:

Usage:
     rank(x, na.last = TRUE,
          ties.method = c("average", "first", "random", "max", "min"))
Arguments:
       ...
     ties.method: a character string specifying how ties are treated,
see 'Details'; can be abbreviated.

This appears contradictory -- the default value is a vector of
strings, while the argument specification requires a single string.
Looking at the code for `rank` shows what is going on -- by using
`match.arg`, `rank` is treating this default value as the list of
legal argument values, not as the default value.  The default is in
fact the first value, "average".

I suspect that this convention is documented somewhere (where?), but I
think it would be useful to make it explicit in the documentation for
`rank`.

            -s



[Rd] Documentation of ties.method argument in `rank`
Stavros Macrakis