|
Replies:
2
-
Pages:
1
-
Last Post:
Jan 24, 2010 5:39 PM
by: robert.kabacoff
|
Threads:
[
Previous
|
Next
]
|
|
Posts:
2
Registered:
5/21/09
|
|
|
|
Use of Attach
Posted:
Aug 26, 2009 3:20 PM
|
|
I see you use the attach() function often, as do most authors. I think you should include some caveats about attach. It makes for more succunct code in a book but is potentially fraught with pitfalls. The most obvious is multiple tables with similarly named variables. It is the equvalent of making all your variables global scope. I find methods such as explicit naming, column slicing and use of with() to make for better, more repeatable data analysis scripts.
|
|
Posts:
74
Registered:
8/3/09
|
|
|
|
Re: Use of Attach
Posted:
Nov 5, 2009 3:29 PM
in response to:
kpierce8
|
|
I would agree when you are writing code to use in batch. In an interactive session, I have separate environments for each project that I am working on and it is very unlikely that I will use more than one dataframe in a session.In this case, I find the use of the attach function very helpful.
It is a good idea to talk about attach/detach and with. I will try to work it in.
Thanks for the idea.
Sincerely,
Rob
|
|
Posts:
74
Registered:
8/3/09
|
|
|
|
Re: Use of Attach
Posted:
Jan 24, 2010 5:39 PM
in response to:
robert.kabacoff
|
|
I am adding a callout on the issues of using attach/detach vs. using with()
Thanks for the suggestion.
Rob
|
|
|
Legend
|
|
Gold: 300
+
pts
|
|
Silver: 100
- 299
pts
|
|
Bronze: 25
- 99
pts
|
|
Manning Author
|
|
Manning Staff
|
|