[R] How to refer to a list member by variable

2008-12-01 Thread Reitsma, Rene - COB
Dear All, I'm hoping one of you can help me with the following R problem. I'm trying to refer to a member of a list by variable. However, this seems not to work: foo=list(first=c(1:10),second=c(11:20)) foo$first [1] 1 2 3 4 5 6 7 8 9 10 foo$first [1] 1 2 3 4 5 6 7 8 9 10

Re: [R] How to refer to a list member by variable

2008-12-01 Thread hadley wickham
On Mon, Dec 1, 2008 at 12:53 PM, Reitsma, Rene - COB [EMAIL PROTECTED] wrote: Dear All, I'm hoping one of you can help me with the following R problem. I'm trying to refer to a member of a list by variable. However, this seems not to work: foo=list(first=c(1:10),second=c(11:20)) foo$first

Re: [R] How to refer to a list member by variable

2008-12-01 Thread Gavin Simpson
On Mon, 2008-12-01 at 10:53 -0800, Reitsma, Rene - COB wrote: Dear All, I'm hoping one of you can help me with the following R problem. I'm trying to refer to a member of a list by variable. However, this seems not to work: foo=list(first=c(1:10),second=c(11:20)) foo$first [1] 1 2