[R] Bug? using { as a function in lapply

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed Sep 29 01:02:50 CEST 2004


Gabor Grothendieck <ggrothendieck at myway.com> writes:

> Peter Dalgaard <p.dalgaard <at> biostat.ku.dk> writes:
> 
> : 
> : Gabor Grothendieck <ggrothendieck <at> myway.com> writes:
> : 
> : > Thanks for pointing out that this is already fixed in the upcoming 
> : > version of R.
> : 
> : It isn't. Look closer.
> : 
> : I'm not sure this qualifies as a bug though. It boils down to
> : 
> : > f <- function(...){...}
> : > f()
> : Error in f() : ... used in an incorrect context
> : 
> : This doesn't work in S-PLUS either:
> : 
> : > f <- function(...){...}
> : > f()
> : Problem in f(): "..." may only be used as an argument in a call
> : Use traceback() to see the call stack
> : 
> : But S(-PLUS) doesn't actually have a function "{", it's part of syntax
> : but not actually put into functions (and if R had better deparsing,
> : may it could do likewise).
> 
> Perhaps that explains why it fails but its not clear to me that this
> justifies the error, especially when you consider the fact that mapply 
> got it right.

mapply doesn't pass "extras" using "...", but uses the MoreArgs list
instead.
-- 
   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-help mailing list