[R] Size of an object in workspace

MORNEAU François francois.morneau at ifn.fr
Tue Apr 24 18:17:31 CEST 2007


Is 'object.size()' the function your are looking for ?



-----Message d'origine-----
De : r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] De la part de Horace Tso
Envoyé : mardi 24 avril 2007 17:59
À : r-help at stat.math.ethz.ch
Objet : [R] Size of an object in workspace

Hi folks,

Is there a function to show the size of an R object? eg. in Kbytes?

Couple months ago Bendix Carstensen posted this marvelous little function lls(), which shows all objects in the current workspace by mode, class and 'size'. This is a wonderful enhancement to the build-in ls() already and I now have it sourced in my Rprofile.site at startup. 

The only drawback is, 'size' is just the length/dim of an object. For matrices and data frames this is good enough. But for a list, knowing how many elements in there doesn't help much. I need to know the totality of the content in a common unit, eg. byte. 

Thanks in advance. 


R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list