[R] attach and object masking

Thomas Lumley
2006-12-19T20:46:53Z

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