Re: [R] ifelse() applied on function

2013-08-11 Thread William Dunlap
> ifelse(ChooseFn, lapply, sfLapply)(MyList, function(x) { > ... > return()) Use 'if', not 'ifelse', and wrap it in parentheses to get the precendence right (if (ChooseFn) lapply else sfLapply)(MyList, function(x){...}) Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com >

Re: [R] ifelse() applied on function

2013-08-11 Thread Steve Lianoglou
Hi, On Sun, Aug 11, 2013 at 1:18 PM, Ron Michael wrote: > Hi, > > How can I apply ifelse function to chose appropriate function? > > My goal is user will chose lapply() function if "ChooseFn = T" otherwise to > chose sfLapply() from snowfall package. > > I am basically trying to avoid repeatatio