Skip to content
Prev 343395 / 398506 Next

What the difference between .Golbalenv and package:base?

On Mon, Aug 25, 2014 at 12:26 PM, John McKown
<john.archie.mckown at gmail.com> wrote:
<snip>
The above does not work because I did it incorrectly. The code below
is the proper way to do this.
[1] 2
[1] 2
[1] "a"
[1] "a" "b"
[1] "b"
It appears that what happens in the original is that the attach() does
not point to the environment, but creates its own copy. In the second
case, attach() creates the environment, then the new line assigns a
"pointer" to that same physical environment to the variable new_name.
I'm learning some _interesting_ things from this discussion.