On Wed, Sep 22, 2010 at 4:04 AM, Joshua Wiley <[email protected]> wrote: > Thanks to everyone for your thoughtful replies. I think I am inclined > not to use attach, but to bring it up and briefly mention some of the > mistakes that are easy to make. If students already know/use attach, > it will at least be clear why I do not use it, and for students > unfamiliar with it, they should not be tempted to start. > > Thanks again for all the responses!
I avoid teaching attach() and discourage its use if the students have already seen it. I do teach both with and within (with provides read-only access, within provides read-write access to the variable names in a data frame or a list). As mentioned in an earlier reply in this thread, the use of extractor functions, like residuals() or fitted() or coef(), should be preferred to reaching inside a data object and grabbing a component that may or may not continue to be defined in future versions, The supplementary material on R that I use in a first-year grad course on applied statistics is available, for this semester, at www.stat.wisc.edu/~st849-1/Rnotes My approach to data organization is shown in the "Introduction to R". _______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-teaching
