[R] sub question

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Feb 3 15:23:17 CET 2009


Wacek Kusnierczyk wrote:
> Gabor Grothendieck wrote:
>> This comes from the all.vars function and would indicate
>> a bug in that base R function.
>>
>>   
> 
> hush!  a user bug, i presume?  but indeed,
> 
> all.vars(expression(foo(bar)()))
> # character(0)
> all.names(expression(foo(bar)()))
> # "foo" "bar"
> 

Semantic quibble!

Notice also that (same thing)

 > all.vars(~ fo(o)(),functions=T)
[1] "~"  "fo" "o"

The quibble is that functions=FALSE (default) can mean

(a) do not descend recursively into the function part (first element) of 
a call
(b) do descend, unless it is a name

what it does is clearly (a), but arguably, (b) is what the documentation 
says. This can be resolved in two ways...

Are there "legitimate" reasons to want behaviour (b)? That is, examples 
that would reasonably arise in practice.

-- 
    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