Re: [R] object size of a matrix and a list

2009-03-18 Thread jim holtman
You were doing for a small size where the overhead masked the gains. Here a larger case where you can see the differences: > #matrix > beta.mat <- matrix(0,nr=500, nc=200) > > #list > gamma.mat <- list(a= matrix(1L, 500, 100), b=matrix(1.0, 500, 100)) > > object.size(beta.mat) [1] 800112

[R] object size of a matrix and a list

2009-03-18 Thread Kyeongmi Cheon
Hello, My program calculates several variables at each iteration and some of them are integers and the rest are numeric. When I save them into a matrix, all of them are of numeric type, of course. I'm trying to find a way to save time/memory of my program and I was thinking that it might help t