Re: [R] Space required by object?

From: jim holtman <jholtman_at_gmail.com>
Date: Wed 27 Sep 2006 - 21:42:41 GMT

Here is a function I use:

 my.ls <- function(pos=1, sorted=F){
   .result <- sapply(ls(pos=pos, all.names=TRUE),

       function(..x)object.size(eval(as.symbol(..x))))    if (sorted){

       .result <- rev(sort(.result))
   }
   .ls <- as.data.frame(rbind(as.matrix(.result),"**Total"=sum(.result)))    names(.ls) <- "Size"
   .ls$Size <- formatC(.ls$Size, big.mark=',', digits=0, format='f')    .ls$Mode <- c(unlist(lapply(rownames(.ls)[-nrow(.ls)],

       function(x)mode(eval(as.symbol(x))))), '-------')    .ls
}

On 9/27/06, Ben Fairbank <BEN@ssanet.com> wrote:
> Does R provide a function analogous to LS() or str() that reports the
> storage space, on disk or in memory, required by objects?
>
> Ben Fairbank
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu Sep 28 07:57:53 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 27 Sep 2006 - 22:30:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.