[R] accessing function arguments as text, macro style

Gabor Grothendieck ggrothendieck at myway.com
Tue May 25 20:15:50 CEST 2004


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"




More information about the R-help mailing list