Skip to content
Back to formatted view

Raw Message

Message-ID: <4E93792B.30205@xtra.co.nz>
Date: 2011-10-10T23:00:59Z
From: Rolf Turner
Subject: question about string to boor?
In-Reply-To: <CAPtE55QzmQxrLEfdT9E=V=OXGfiHy-3fPynSyx0Dx8NkpNLizg@mail.gmail.com>

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