R equivalent to funcall?
On Thu, 17 Mar 2005 15:11:50 +0100 (CET), Johannes H?sing <johannes at huesing.name> wrote :
On Thu, 17 Mar 2005 13:20:32 +0100 (CET), Johannes H?sing <johannes at huesing.name> wrote :
[...]
Is there a way that the dot-dot-dot argument of a function accepts a list as single arguments, such as funcall in several Lisp dialects?
do.call() comes close to what you want.
[...] Indeed it does. Thank you very much. I have overlooked that function.
Here's a variation on my suggestion from Luke Tierney that preserves the special handling of the x and y arguments to plot():
opts <- list(cex=2, lty=3, type='b') do.call(function(...) plot(1:10,rnorm(10),...), opts)
Duncan Murdoch