[R] Seeing Global Workspace and dealing with attach and detach

2013-02-19 Thread David Arnold
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,

Re: [R] Seeing Global Workspace and dealing with attach and detach

2013-02-19 Thread Jeff Newmiller
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.

Re: [R] Seeing Global Workspace and dealing with attach and detach

2013-02-19 Thread Ben Bolker
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