[Rd] Re: [R] Is k equivalent to k:k ?
Peter Dalgaard
p.dalgaard at biostat.ku.dk
Fri Dec 10 14:41:02 CET 2004
Martin Maechler <maechler at stat.math.ethz.ch> writes:
> RichOK> "from", "to", "by", "length.out", "along.with"
> RichOK> ^^^^ ^^^^^
> RichOK> when the help page for seq documents them as
> RichOK> "from", "to", "by", "length", and "along"?
>
>
> Well I can explain why this wasn't caught by R's builtin
> QA (quality assurance) checks:
>
> The base/man/seq.Rd page uses both \synopsis{} and \usage{}
> which allows to put things on the help page that are not checked
> to coincide with the code...
> I'm about to fix this (documentation, not code).
In the case of "length", I think there's a historical explanation for
having the formal argument being a slightly lengthened version of what
you'd like to use as the actual argument: "length" is the obvious
choice of name for the argument, but if you used that in older
versions of S and R then it would mask the length() function and get
you in all sorts of trouble, or at least spit out a number of annoying
warning messages. (On a related note, you may have noticed that some
of the oldtimers still have knee-jerk reactions to people using "c"
and "t" for variable names). So call it something longer and let
partial matching allow users to use the short form.
With namespaces, base::length(v) would clear up the issue quite
nicely, as would the convention of looking for objects of mode
"function" if it is clear from the context that a function is needed.
However, seq() predates both of these features as far as I remember.
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-devel
mailing list