[R] attach and object masking

Thomas Lumley tlumley at u.washington.edu
Tue Dec 19 21:46:53 CET 2006


On Tue, 19 Dec 2006, DEEPANKAR BASU 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.
>

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



More information about the R-help mailing list