0

Can anyone help me why I get this type of error every time I upload the data in R? Any solution for that?

enter image description here

Phil
  • 7,287
  • 3
  • 36
  • 66
  • This is a message, not an error. Also, an indication that you should not use `attach()`, see https://stackoverflow.com/questions/10067680/why-is-it-not-advisable-to-use-attach-in-r-and-what-should-i-use-instead – Phil Jan 31 '23 at 15:24

1 Answers1

0

The data you're reading in probably has the columns poison, time and treat. For some reason these words are already taken in R's namespace.

When you attach the table, R tries to assign the names poison, time, and treat to refer to the respective columns. An example with the sleep dataset:

data1 <- as.data.frame(sleep)
names(sleep)
[1] "extra" "group" "ID"
attach(data1)
# Now ID is assigned to data1.ID in R's namespace

data2 <- as.data.frame(sleep)
attach(data2)

# The message you're getting
The following objects are masked from data1:

extra, group, ID

To avoid this problem, which can lead to unintended outcomes, make sure to call detach(data1) before attaching further datasets with non-unique column names.

ttobe
  • 36
  • 4