[R] deciphering help for `attach`

PIKAL Petr
Mon, 27 Apr 2020 13:00:39 -0000

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