Hi Hao, Ok.
Sorry for my last post. bests milton On Tue, Dec 29, 2009 at 3:08 PM, Hao Cen <h...@andrew.cmu.edu> wrote: > Hi, > > I wonder how to pass several functions and their arguments as arguments to > a function. For example, the main function is > > f = function(X ) { > process1(X) > ... > > > process2(X) > } > > I have a few functions that operate on X, e.g. g1(X, par1), g2(X, par2), > g3(X, par3). par1, par2 and par3 are parameters and of different types. I > would like to pass g1, g2, g3 and their arguments to f and g1, g2, g3 may > appear to be in different orders. So that final effect of the passing is > > f = function(X ) { > process1(X) > g1(X, par1) > g2(X, par2) > g3(X, par3) > process2(X) > } > > If I pass g2(X, par2),g3(X, par3), g1(X, par1) to f, I would expect to get > the effect of > f = function(X ) { > process1(X) > g2(X, par2) > g3(X, par3) > g1(X, par1) > process2(X) > } > > Appreciate any suggestions. > > thanks > > Jeff > > > ps please ignore my previous blank subject email. It was accidentally sent > before the letter was completed. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.