0

Everytime, I use attach(data) in R, I get a message:

The following objects are masked from data (pos = 5):

The pos number keeps increasing every time.

Is there something to be concerned and why does it occur?

Nakx
  • 1,460
  • 1
  • 23
  • 32
Amith1989
  • 1
  • 1
  • 4
    The recommendation is [not to use attach](https://stackoverflow.com/questions/10067680/why-is-it-not-advisable-to-use-attach-in-r-and-what-should-i-use-instead). Or if you do, make sure you `detach()` before re-attaching. But most modern R code avoids that function. – MrFlick Apr 28 '20 at 05:57
  • Adding to @MrFlick because the same happens with packages, more and more people avoid loading packages and just use `package::function()` – Nakx Apr 28 '20 at 06:10
  • That `pos` number means you have `attach`ed that data set multiple times. And every time you do it you will create another copy of the data set. Then, if you happen to need the data, what copy are you using? – Rui Barradas Apr 28 '20 at 06:22

0 Answers0