Skip to content

attach and object masking

4 messages · Deepankar Basu, Thomas Lumley, Marcin Jaworski

#
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:
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.

Thanks.
#
On Tue, 19 Dec 2006, DEEPANKAR BASU wrote:

            
It means that 'write' is the name of a variable in the dataset. R is 
warning you that you have two things called 'write' -- your variable and a 
function in the base package.

It also means that you have missed at least three upgrades of R (the 
fourth is just out) since in version 2.3.0 and more recent you don't get 
the warning when a variable and a function have the same name, only for 
two variables or two functions.  There have been quite a lot of other 
changes since your version of R, so it would be worth upgrading.

 	-thomas
#
On Tue, 19 Dec 2006, Thomas Lumley wrote:
I just noticed I didn't say explicitly whether you need to do anything 
else about the warning. You don't.

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

            
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