[R] accessing list components with a variable
David C. James
dj at davidcjames.com
Sat Jul 14 02:47:40 CEST 2007
Let's say I have a list called the_list consisting of three components:
Now, I want to access it using a variable called comp.
comp <- "component_1"
I'm looking for some function that let's me do this:
Which should do the same thing as:
Any ideas? I'd be open to other ways of doing this, too. I explored
this way, but it didn't seem to get me anywhere:
I possibly could have gotten further along if I knew how to do
evaluation in R.
More information about the R-help