Skip to content
Prev 22731 / 398502 Next

Peculiar behavior of attached objects

Sorry, but you mis-read the help page for `attach', and your explanation
is poppycock.
[1] 10
[1] "d"

There is no `new variable': you are still seeing the one in the database
which is attached. As the help page clearly says, that is not changed but
a copy in the global environment is.

You can change the attached copy by direct use of assign():
[1] 30

but that does not change d.  You can also detach and attach.

If you find the R documentation terse (it can be) do cross-check the S
documentation (and this point is in both Venables & Ripley books, too).
On Sat, 17 Aug 2002, Greg Hammett wrote: