[R] Variable passed to function not used in function in select=... in subset

Peter Dalgaard P.Dalgaard at biostat.ku.dk
Tue Nov 11 19:01:20 CET 2008


Berwin A Turlach wrote:
> G'day Duncan,
> 
> On Tue, 11 Nov 2008 09:37:57 -0500
> Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
> 
>> I think this tension is a fundamental part of the character of S and
>> R. But it is also fundamental to R that there are QC tests that apply
>> to code in packages:  so writing new tests that detect dangerous
>> usage (e.g. to disallow partial name matching) would be another way
>> to improve reliability.  [...]
> 
> Please not. :)
> After years of using of R, it is now second nature to me to type (yes,
> I always spell out "from" and "to") 
> 	seq(from=xx, to=yy, length=zz)
> and I never understood why the full name of that argument had to be
> length.out.  I would hate to see lots of warning messages because I am
> using partial matching.

I think the story is this:

At some point in time, in a galaxy not too far away, and using one of
the R-like languages, calling the argument "length" gave you trouble
calling length(from) inside the function ("attempt to call non-function"
or some such error). Later, this issue was fixed so that function calls
would look for functions only, but by then, the name couldn't be changed
since some people had been writing it out in full.

(There are a couple of other cases, one of them involving an argument
ending in a ".", but I forgot what they are. I don't think there was
ever an along() function, so "along.with" escapes me.)

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



More information about the R-help mailing list