Imagine you have an object foo
that you saved as saved.file.rda
as follows:
foo <- \'a\'
save(foo, file=\'saved.file.rda\')
<
Assuming there is only one object saved in saved.file.rda
, about:
bar <- load('saved.file.rda')
the.object <- get(bar)
or just:
bar <- get(load('saved.file.rda'))
If you want to be "neat" and not pollute your global workspace with the stuff you loaded (and forgot the name of), you can load your object into an environment, and specify that environment in you call to get
.
Maybe:
temp.space <- new.env()
bar <- load('saved.file.rda', temp.space)
the.object <- get(bar, temp.space)
rm(temp.space)
...