On 11/10/11 08:21, Christoph Molnar wrote:
Hi Nellie,

hope I got you right. I guess you want something like that.

for (i in 1:7) {
    oneOfNelliesArray<- eval(parse(text=paste("grp",i, sep="")))
    anyFunction(oneOfNelliesArray)
}

Paste() just returns you a string. But you want R to evaluate the
expression. So you have to parse it and tell R to evaluate it.

But using get() is so much simpler and safer.

    cheers,

        Rolf Turner

______________________________________________
R-help@r-project.org 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