Hi all, I have a question regarding the memory usage for the attach function. Say I have a data.frame inputdat that I create with read.csv. I would like to know what happens on the memory side when I use attach(inputdata) Is there a second allocation of memory for inputdata? Then I'm using eval on a expression which depends on the columns of inputdata. Is it better not to use attach function? Thanks in advance Christophe -- Christophe Dutang Ph.D. student at ISFA, Lyon, France website: http://dutangc.free.fr
Christophe Dutang1 wrote:> > > I would like to know what happens on the memory side when I use > attach(inputdata) > > Is there a second allocation of memory for inputdata? >Not, it just guides the syntax. Christophe Dutang1 wrote:> > Is it better not to use attach function? >A qualified "yes" in the sense of "do not use it". I think it is used to much in old documentation, presumably because some S eggshells. I use with() if I have a nasty formula to unclutter; it acts locally only and you don't get unwanted side effects. Dieter -- View this message in context: http://www.nabble.com/attach-tp25885494p25886141.html Sent from the R help mailing list archive at Nabble.com.
On Wed, 2009-10-14 at 07:21 +0200, Christophe Dutang wrote:> Hi all, > > I have a question regarding the memory usage for the attach function. > Say I have a data.frame inputdat that I create with read.csv. > > I would like to know what happens on the memory side when I use > attach(inputdata) > > Is there a second allocation of memory for inputdata? > > Then I'm using eval on a expression which depends on the columns of > inputdata. Is it better not to use attach function? > > Thanks in advance > > ChristopheWell, if you attach a data.frame twice times, it use your memory twice times. I don't use attach I prefer with(data.frame, command) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil