On Wed, Aug 29, 2012 at 4:14 PM, William Dunlap <wdun...@tibco.com> wrote:
> deparse(substitute(fnc)) will get you part way there.
...
> I like to let the user override what substitute might say by
> making a new argument out of it:
>> applyFunc(function(x)x*10, 1:3)
> fnc is function(x) x * 10
> [1] 10 20 30
>> applyFunc(function(x)x*10, 1:3, fncString="Times 10")
> fnc is Times 10
> [1] 10 20 30
> This makes is easier to call your function from another one - you
> can pass the fncString down through a chain of calls.

Thanks, very good suggestions. The function I am writing is of course
much more complicated than the simplistic example.

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