[R] attach

Bernardo Rangel Tura tura at centroin.com.br
Sun Oct 18 10:42:11 CEST 2009


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
> 
> Christophe

Well, 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




More information about the R-help mailing list