[R] attach and object masking

Marcin Jaworski
2006-12-19T23:01:13Z

DEEPANKAR BASU <basu.15 at osu.edu> wrote:

>Hi R users!
>
>I am new to R. When I try to attach a simple dataset using the attach()
>command, I get the following message:
>
>> attach(data1)
>
>        The following object(s) are masked from package:base :
>
>         write
>
>Can someone tell me what this means? (`write' is the name of a variable
>in the dataset). And, do I need to do do something about this.

Hi,
I guess, you need not to do anything, unless you want to work with the
variable 'write' from dataset you try to attach. But if you do want use
it safely (?), one way is to rename the variable from your dataset, not
to double the name from the package that is already attached (check
out search() to know the pecking order ;) and use ?attach to interprete
the help page for yourself). The package gdata make the renaming process
easier for me.

MJ