Open JoFAM opened 6 years ago
Quite a few people still learn to attach(df) for working with data. This is a dangerous approach, as you get confusion about where results of a transformation are stored:
attach(df)
attach(iris) Sepal.Length <- round(Sepal.Length, 0)
Now Sepal.Length and iris$Sepal.Length are two different things.
Sepal.Length
iris$Sepal.Length
Personally I would even throw an error from the moment attach() is used. See also the session Good Practice in ?attach.
attach()
?attach
Quite a few people still learn to
attach(df)
for working with data. This is a dangerous approach, as you get confusion about where results of a transformation are stored:Now
Sepal.Length
andiris$Sepal.Length
are two different things.Personally I would even throw an error from the moment
attach()
is used. See also the session Good Practice in?attach
.