[R] How to name a tag in a list or a data.frame from a string?

2009-11-15 Thread Peng Yu
Suppose I have a string variable string='some_string' Now I want to have a list, where tag is the same as the string in the variable string. I'm wondering if this is possible in R. list(tag=1:3) data.frame(tag=1:3) __ R-help@r-project.org mailing

Re: [R] How to name a tag in a list or a data.frame from a string?

2009-11-15 Thread Duncan Murdoch
On 15/11/2009 8:15 PM, Peng Yu wrote: Suppose I have a string variable string='some_string' Now I want to have a list, where tag is the same as the string in the variable string. I'm wondering if this is possible in R. list(tag=1:3) data.frame(tag=1:3) The most straightforward way is x -