Displaying 1 result from an estimated 1 matches for "applyfnc".
Did you mean:
applyfunc
2012 Aug 29
5
Extracting the name of a function (inverse of match.fun("myFun"))
...ed 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