[R] protecting "..."

Johannes Hüsing johannes at huesing.name
Sun Nov 18 05:33:04 CET 2007


Duncan Murdoch <murdoch at stats.uwo.ca> [Sat, Nov 17, 2007 at 11:56:52PM CET]:
> On 17/11/2007 5:04 PM, Johannes Hüsing wrote:
> >I just realized that the "..." argument in a function cannot be used 
> >without
> >taking precautions sometimes. The following behaviour is what I 
> >stumbled upon:
> 
> The problem is the way replicate is implemented.  It takes the 
> expression, and wraps it in a function(...) before calling sapply.  The 
> ... in your expression matches the ... in the wrapper function, not the 
> ... from the parent.

Many thanks! Pose a question, go to sleep, wake up, read the answer.
I feel like being in old Cologne 
(http://en.wikipedia.org/wiki/Heinzelm%C3%A4nnchen).


> 
> I think you'll need to make calls to sapply directly to do what you 
> want.
> 

Do you mean to replace "replicate" by the contents of the function?
I am feeling more comfortable with my solution.
-- 
Johannes Hüsing               There is something fascinating about science. 
                              One gets such wholesale returns of conjecture 
mailto:johannes at huesing.name  from such a trifling investment of fact.                
http://derwisch.wikidot.com         (Mark Twain, "Life on the Mississippi")



More information about the R-help mailing list