I have list which has some objects and I want to get the object in a loop. I use now this code but I don’t know why it didn’t answer!!
test1 <- list(a=c(1,2,3,4),b=rnorm(100))
test1$a
[1] 1 2 3 4
but when I want to load it via get in a loop I could’t.
for example
get("test1$a")
Error in get("test1$a") : object 'test1$a' not found
So, How can I load this objects of a list via a command like this?
You have to use
since the object’s name is
test1, nottest1$a.