Skip to content
Prev 366015 / 398502 Next

how do I define a function which is equivalent to `deparse(substitute(x))`?

Dear R-Help,

I was going to ask Jeff to read the entire works of William
Shakespeare to learn why his reply was not helpful to me...

Then I realized that the answer, as always, lies within...

    desub <- function(y) {
      e1=substitute(y, environment())
      e2=do.call(substitute,list(e1), env=parent.frame())
      deparse(e2)
    }

Sorry to trouble the list; other solutions still welcome.

Cheers,

Frederick
On Sun, Dec 11, 2016 at 12:46:23AM -0800, Jeff Newmiller wrote: