I'm using mapply()
to save elements from a list in separate files. E.g.
file.names <- c('~/a.RData', '~/b.RData')
data.list <- list(foo = c(1:10), bar = rep(1, 10))
mapply(function(x, y) save(x, file = y), data.list, file.names)
and I'd like to be able to call the elements by their original name after loading them again. Now I get
load('~/a.RData')
ls()
"x"
but I'd like to get
load('~/a.RData')
ls()
"foo"