Re: [R] match.call to obtain the name of a function

2010-02-26 Thread Henrique Dallazuanna
Try this: foo <- function() sprintf("The name of this function is %s", gettext(match.call())) On Fri, Feb 26, 2010 at 5:22 PM, Jacob Wegelin wrote: > > Within a function I'd often like to obtain a text string equal to the name > of the function. > > One use for this: To generate a filena

[R] match.call to obtain the name of a function

2010-02-26 Thread Jacob Wegelin
Within a function I'd often like to obtain a text string equal to the name of the function. One use for this: To generate a filename for use in pdf(). This enables me to keep track of which function generated a particular graphic came. match.call() puts parentheses at the end of the name. I d