[R] Matrix "BYTES" size

jim holtman jholtman at gmail.com
Tue May 8 02:50:17 CEST 2012


If all you want are binary 0/1, then look at the 'bit' package which
will let you create a vector of bits.  Even for your matrix, you will
need almost 1GB of memory to store a copy.

On Mon, May 7, 2012 at 5:23 PM, Lucas <lpchaparrovio at gmail.com> wrote:
> Dear R people.
> I惴 facing a big problem.
> I need to create a matrix with 10.000 columns and 750.000 rows.
> matrix<- as.data.frame(matrix(data=0L, nrow=750000, ncol=10000)
> as you can see, the data frame has huge dimesions. I was able to find out
> about thr "L" in data, this way I惴 telling that my data is "integer"
> class. By doing this
> object.size(matrix) tells me that this is half of the matrix when I don愒
> define as integer (L)
> The data that I惻l be filling with my matrix will be 0 and 1, nothing else,
> so I could use less bytes.
> so, my cuestion is, How can I create the same matrix but using even less
> bytes?
>
> I惻l appreciate if you can help me.
>
> Thank you.
> Lucas
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org 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
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.



More information about the R-help mailing list