Search and term variables by character string

Viewed 33

I have a maybe simple problem, but I can't solve it. I have two list's. List A is empty and a list B has several named columns. Now, I want to select a colum of B by a variable and put it in list A. Somehow like shown in the example:

A<-list()
B<-list()
VAR<-"a"

B$a<-c(1:10)
B$b<-c(10:20)
B$c<-c(20:30)

#This of course dosn't work...
A$VAR<-B$VAR
1 Answers
Related