[R] R equivalent to funcall?

Duncan Murdoch murdoch at stats.uwo.ca
Fri Mar 18 00:24:43 CET 2005


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




More information about the R-help mailing list