[R] Create macro_var in R

Henrik Bengtsson henrik.bengtsson at gmail.com
Wed Feb 3 18:48:37 CET 2016


Don't know what `population` is, but a simple assignment

MVAR <- population

may provide what you need.  Note, no c().  For example,

> foo <- rnorm
> foo(3)
[1] -0.08093862 -0.87827617  1.52826914

/Henrik

On Wed, Feb 3, 2016 at 9:41 AM, Amoy Yang via R-help
<r-help at r-project.org> wrote:
>  There is a %LET statement in SAS: %let MVAR=population; Thus, MVAR can be used through entire program.
> In R, I tried MAVR<-c("population"). The problem is that MAVR comes with double quote "...." that I don't need. But MVAR<-c(population) did NOT work out. Any way that double quote can be removed as done in SAS when creating macro_var?
> Thanks in advance for helps!
> Amoy
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list