[R] How to properly use a generated test string as a name?
Mark Knecht
markknecht at gmail.com
Wed Feb 9 20:52:35 CET 2011
On Wed, Feb 9, 2011 at 11:20 AM, Erik Iverson <eriki at ccbr.umn.edu> wrote:
>
>
> Mark Knecht wrote:
>>
>> Title asks it all.
>>
>> Thanks in advance,
>> Mark
>>
>> a = 1:5
>> b1 = 2:6
>> Z = data.frame(a,b1)
>> Z
>>
>> Z$b1
>>
>> count = 1
>>
>> MyName = paste("b",count,sep="")
>> MyName
>>
>> Z$MyName
>
> Z[[MyName]]
>
Thank you Erik. I don't think I would have found that for days.
Cheers,
Mark
More information about the R-help
mailing list