Hi all,

is there a way to extract the name of a function, i.e. do the reverse
of match.fun applied to a character string? I would like to print out
the name of a function supplied to another function as an argument.

For example:

myFunc = function(x) { x+1 }

applyFunc = function(fnc, x)
{
  fnc = match.fun(fnc)
  fnc(x)
}

Is there a way to obtain "myFunc" from the argument fnc in applyFnc
the following call is issued?

applyFnc(myFunc, 1)



Thanks,

Peter

______________________________________________
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.

Reply via email to