Skip to content

function application

4 messages · Roy Shimizu, Erik Iverson, Phil Spector

#
In this particular case, because you want to create a list,

x <- 1:10
as.list(x)

will do.
In general, if you already have a *list* and want to call a function
with the contents of that list as the arguments, then ?do.call is what
you need.

a <- list("example", "of", "do.call")

#compare the two following expressions
paste(a)
do.call(paste, a)


--Erik
#
?do.call

Please provide a reproducible example if the help file is 
not sufficient.

 					- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu
On Tue, 25 Jan 2011, Roy Shimizu wrote:

            
#
On Tue, Jan 25, 2011 at 5:12 PM, Phil Spector <spector at stat.berkeley.edu> wrote:
Erik, Phil, thanks!

Roy