If you have a list
but you want each element of the list to be it\'s own separate element in the global environment e.g.
alist <- list( c(1,2
Use list2env
alist <- list( a=c(1,2), b=c(3,4) ) # naming list elements
list2env(alist, envir = .GlobalEnv)
If your elements aren't named, then you can do mapply
with assign:
mapply(assign, list("a","b"), alist, MoreArgs=list(envir=.GlobalEnv))
> ls()
## [1] "a" "alist" "b"
But what Roland said.