Re: [R] Use function parameter as an unevaluated text string

2014-01-29 Thread William Dunlap
Use substitute(argumentName) to get the literal argument, as a language object, and deparse() to convert that into a character vector. That vector could be quite long (especially what your function is called via do.call) so you may want to truncate it. > doit2 <- function (data) { dataName

Re: [R] Use function parameter as an unevaluated text string

2014-01-29 Thread Richard M. Heiberger
doit <- function(data) { cat("This function is using values from the data frame", deparse(substitute(data)), "\n") } On Wed, Jan 29, 2014 at 6:48 PM, John Sorkin wrote: > I would like to take a parameter passed to a function as a text string. I > don't want the parameter evaluated, I want it u