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

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

From: Gabor Grothendieck (ggrothendieck@myway.com)
Date: Wed 26 May 2004 - 04:15:50 EST


Message-id: <loom.20040525T201511-168@post.gmane.org>

Ed L Cashin <ecashin <at> uga.edu> writes:
> function parameters to know how to do something like this (ficticious
> example):
>
> f <- function(x) { paste(identifier(x), value(x)) }
> > rambo <- "brave"
> > f(rambo)
> "rambo brave"

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

______________________________________________
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