[Rd] attach behavior

Prof Brian D Ripley ripley at stats.ox.ac.uk
Sun Aug 29 09:09:08 CEST 2004


On Sun, 29 Aug 2004, Erich Neuwirth wrote:

> In R 1.9.1, attaching an object more than once puts the object's name on
> the search path more than once also. Therefore, to remove it, one has to
> detach it multiply.
> Wouldn'tn it make sense to change the behavior of attach in a way
> that object names are not added to the search path more than once?

They need not be the same object, so no.  It's quite common practice to
modify an object, attach it temporarily and detach it again.  I suspect
that people using attach() frequently should be thinking more in terms of
with().

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list