Re: [R] accessing function arguments as text, macro style

About this list Date view Thread view Subject view Author view Attachment view

From: Ed L Cashin (ecashin@uga.edu)
Date: Wed 26 May 2004 - 04:22:22 EST


Message-id: <877jv0l63l.fsf@uga.edu>

Gabor Grothendieck <ggrothendieck@myway.com> writes:

...
> R> f <- function(x) paste(as.character(substitute(x)),x)
> R> z <- 3
> R> f(z)
> [1] "z 3"

Fantastic. Works like a charm.

-- 
--Ed L Cashin            |   PGP public key:
  ecashin@uga.edu        |   http://noserose.net/e/pgp/

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:12 EST