Reputation: 17299
Suppose I have a named list x
:
x <- list(a = 1, b = 2)
How can I load the content of x
into the global environment so that I can access a
and b
from the global environment?:
a
# [1] 1
b
# [2] 2
(why I do this: in reality, the x
is derived from a .mat
file produced by matlab. It's more like an .Rdata
file)
Upvotes: 6
Views: 360
Reputation: 51
You could also use attach(x) to make a and b available in the search list.
Upvotes: 1