[R] detach()

Liaw, Andy andy_liaw at merck.com
Mon Mar 22 21:49:31 CET 2004


> From: Liaw, Andy
> 
> > From: Rolf Turner
> > 
> > Dear Brian,
> > 
> > You wrote:
> > 
> > > If that is to be allowed, then it has to take precedence. 
> What would
> > > you expect if I did
> > > 
> > > data(women)
> > > attach(women)
> > > women <- 4
> > > detach(women)
> > 
> > I would basically expect either all hell to break loose, mainly
> > because of the overwriting of ``women'' or the data base in position
> > 4 to be detached.
> 
> Don't think so.  attach(women) places a copy of `women' in 
> search position
> 2.  women <- 4 creates another object holding the value 4 in 
> the global
> environment.  No data have been destroyed or overwritten.  

I forgot about the first line, data(women), which loads `women' into the
global environment, and that _is_ overwritten by the line women <- 4.

Andy


------------------------------------------------------------------------------Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message.  If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.




More information about the R-help mailing list