[R-sig-teaching] pros/cons of teaching attach()

Murray Jorgensen maj at waikato.ac.nz
Wed Sep 22 07:03:36 CEST 2010


Hi Joshua,

I do teach R to my students and face each time what to do about attach() 
.  I can't really add to your clear statement of the main reasons for 
and against teaching attach() and I tend sometimes to go one way and 
sometimes the other.

Regards,  Murray

On 22/09/2010 4:34 p.m., Joshua Wiley wrote:
> Hi all,
>
> I am wondering if anyone teaches the attach function to new students
> and if so, why?
>
>
> I have never taught a class using R, but in small tutorials and
> providing direct help, I have run across this issue several times.  I
> have always avoided it, but a couple of times, students had learned to
> use it in a class (though without much detail) and were rather grumpy
> with me for using full variable names or with().  New converts,
> particularly from GUIs like SPSS, already tend to be leery of R, and I
> hate to make working at the command line more onerous since any typing
> is more than they are used to, but at the same time a discussion of
> environments, which I think is necessary to avoid trouble with attach,
> does not seem like beginner material either.
>
> I have wondered about this many times, but was just reminded again by
> an R-help post.
>
> Thanks,
>
> Josh
>


-- 
Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz    majorgensen at ihug.co.nz      Fax 7 838 4155
Phone  +64 7 838 4773 wk    Home +64 7 825 0441   Mobile 021 0200 8350




More information about the R-sig-teaching mailing list