[R] Object size in bytes

Peter Malewski y0004379 at tu-bs.de
Fri Sep 1 13:52:45 CEST 2000


On Fri, 1 Sep 2000, Nicholas Lewin-Koh wrote:

> Hi,
> Is there a command that will give the total size of an R object in bytes?
> 
> thanks 
> Nicholas

You can do it in an indirect way by duplicating (removing) the object:

e.g.:
>  x <- gc()
>  x <- gc()
> kfehbo1 <- kfehbo
>  z <- gc()
> z-x
          free total (Mb)
Ncells    -405     0    0
Vcells -136822     0    0


and then calc the mb needed for the particular object.

P.




----

P.Malewski, Maschplatz 8, 38114 Braunschweig, Tel.: 0531 500965, 
At work: (MH-Hannover): 0511 532 3194 / Fax: 0511 532 3190, 
P.Malewski at tu-bs.de, peter.malewski at gmx.de, malewski.peter at mh-hannover.de.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list