Also note that there is match.funfn in the gsubfn package. That allows you to also pass functions defined as formulas:
e.g. library(gsubfn) f.at.four <- function(f) match.funfn(f)(4) f.at.four(sqrt) # 2 f.at.four("sqrt") # 2 f.at.four(~ x^.5) # 2 - uses function(x) x^.5 See homepage, ?match.funfn and the vignette. On Mon, Mar 10, 2008 at 11:46 AM, Yuri Volchik <[EMAIL PROTECTED]> wrote: > > Thanks, > > match.fun is what i was looking for :-) > > > > > > > Or perhaps: > > myfun <- function(fname, ...)match.fun(fname)(...) > > On 07/03/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Was wondering if it is possible to pass function name as a parameter > > > -- > View this message in context: > http://www.nabble.com/Passing-function-to-tapply-as-a-string-tp15891151p15950836.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > > 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. > ______________________________________________ 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.