[Rd] Modifying parsed code
ggrothendieck at gmail.com
Fri Jul 7 14:51:47 CEST 2006
Assuming the desired output is a character string try:
> f <- function(x) deparse(substitute(x))
 "3 + y"
On 7/7/06, hadley wickham <h.wickham at gmail.com> wrote:
> I would like to take this:
> .img(plot(1:10), filename="a")
> and produce
> ie. whenever .img is used, I want to take the first argument and throw
> away everything else.
> (I am trying to produce a Sweave like environment in which I can apply
> certain functions, but not have them displayed in the output)
> I think I should be able to do it using substitute, but I don't know
> how to operate on language objects. Any hints would be appreciated.
> R-devel at r-project.org mailing list
More information about the R-devel