Hi,
When writing a script, I often start with:
library(ISwR)
attach(thuesen)
Then write some more code, testing it as I write to see if it runs.
Then, at the end, a final:
detach(thuesen)
However, what happens is that I often get errors, which cause an attach, but
no subsequent detach. Now,
In general, creating variables while attached leads to problems such as you
describe. Normally the recommendation is to avoid the use of attach and detach
entirely in favor of explicit reference to the data frame using [[]], [,], $,
and the data= argument supported by many functions.
Jeff Newmiller jdnewmil at dcn.davis.ca.us writes:
In general, creating variables while attached leads to problems such
as you describe. Normally the recommendation is to avoid the use of
attach and detach entirely in favor of explicit reference to the
data frame using [[]], [,], $, and the
3 matches
Mail list logo