[R] Clearing out or reclaiming memory

gug guygreen at netvigator.com
Wed Jul 1 02:02:00 CEST 2009


Thanks to everyone who has posted.  These posts have really helped me to
budge forward my understanding of R, as well as giving me a couple of new
areas that I still need to work on.

These (below) won't be news to the people who have posted, but for anyone
who is in my position, here are a couple of expressions that I came across
as a result of following these leads, that are quite useful:

      sapply(ls(), function(x) object.size(get(x)))
-This lists all objects with the memory each is using (I should be honest
and say that, never having used "sapply" before, I don't truly understand
the syntax of this, but it seems to work).

      rm(list=ls())
-This clears out the memory for every object.

Guy


Bert Gunter wrote:
> 
> 
> It is usually better (and easier) to use the data argument that comes with
> many modelling functions....
> 
> -- Yes. And for functions without a data argument, see  ?with.
> 
> Bert Gunter
> Genentech Nonclinical Biostatistics
> 

-- 
View this message in context: http://www.nabble.com/Clearing-out-or-reclaiming-memory-tp24268680p24281964.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list