[R] how to make this get command work?

ce zadig_1 at excite.com
Thu Dec 18 04:24:56 CET 2014


Dear all,

If I have a list like this how I can get an object of it  with a variable :

foo<-list(A = c(1,3), B =c(1, 2), C = c(3, 1))
var <- "A"

get(paste("foo$",'A',sep=''))
Error in get(paste("foo$", "A", sep = "")) : object 'foo$A' not found



More information about the R-help mailing list