Re: [R] Using the object of character data type as the name of the slot

2007-06-21 Thread Duncan Murdoch
On 21/06/2007 4:07 PM, Alex Tsoi wrote: > Dear all, > > I have a character string object: > >> chara > [1] "The name of first slot" > > and a list object: > >> class( try1) > [1] "list" > > > what I want to do is to use the chara as a slot's name of "try1". > > Of course I could do it like

[R] Using the object of character data type as the name of the slot

2007-06-21 Thread Alex Tsoi
Dear all, I have a character string object: > chara [1] "The name of first slot" and a list object: > class( try1) [1] "list" what I want to do is to use the chara as a slot's name of "try1". Of course I could do it like: > try1$"The name of first slot" <- matrix("", 3, 4) to create a s