Hi All

I am pretty new to R but saw stata and sas's macro facilities and am looking 
for 
how such things work in R.

I am trying to piece together a series of statements:


n = 5   #want to have it dynamic with respect to n
for (j in 1:n) {
eval(paste("x", j, "=x[", j, "]", sep=""))
}

I want the created statements 'x1=x[1]' immediately executed and tried to do 
that with eval() but that did not work.

Any hints greatly appreciates.

Thanks Toby

______________________________________________
[email protected] mailing list
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.

Reply via email to