[R] deciphering help for `attach`

Edward McNeil
Mon, 27 Apr 2020 13:26:11 -0000

Dear Petr,
Thanks for your quick reply. Much appreciated. However, you haven't really
answered
either of my questions, although I don't quite understand your reference to
La Gioconda.

In any case, despite your strong recommendation not to use `attach`, I am going
to keep
using it, as I have done successfully for the past 16 years, and keep teaching
it, until
it either kills me or disappears from R. Unfortunately I have to teach R to
students and
I don't like it when they ask me "tricky" questions to which I
have no answer. ;)
--
Edward McNeil

On Mon, April 27, 2020 8:00 pm, PIKAL Petr wrote:
Hi.

I strongly recommend not to use attach. I agree that mentioned statements are
rather
contradictory and probably others could give you more insightful answer. You
could
consider that by attaching some data, you create something like a copy of
original data
in your system with a feature that you can use column names directly. If you
change
something in the data after attachment, you change only attached version and not
an
original.

It is similar as if you take a picture of Gioconda an use some creativity to add
a
moustache to this picture. In any circumstances moustache does not propagate to
the
original Louvre painting. Do not perform any tricks, preferably do not perform
attach.

Cheers
Petr

> -----Original Message-----
> From: R-help <r-help-bounces at r-project.org> On Behalf Of Edward
McNeil
> Sent: Monday, April 27, 2020 2:07 PM
> To: r-help at r-project.org
> Subject: [R] deciphering help for `attach`
>
> Hi,
> I have two related questions.
>
> 1. In the help page for `attach` under "Details" it says in
paragraph 3:
> "By default the database is attached ..."
>
> But then paragraph 4 starts: "The database is not actually
attached."
>
> Could somebody explain this contradiction? Is the data(base) attached or
> not?
>
> 2. What is meant by the 5th paragraph: "One useful ?trick? is to use
what > NULL (or equivalently a length-zero list) to create a new environment
on the
> search path into which objects can be assigned by `assign` ... "?
>
> I don't understand what this "trick" is or why a
"trick" needs to be performed
> here.
>
> Thanks
> --
> Edward McNeil
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html