[R] Handling functions as objects

Julio Sergio juliosergio at gmail.com
Thu Mar 29 19:59:46 CEST 2012


David Winsemius <dwinsemius <at> comcast.net> writes:

> 
> 
> There is also the `do.call` function to construct proper calls from a  
> character that matches the name of a function
> 
>   f1 = function(foo) {
>       do.call(foo, list(1,2))
>    }
> 
>   f1("+")
> [1] 3
> 

Thanks David, this information has been very useful!

--Sergio.



More information about the R-help mailing list