Quantcast

Matrix "BYTES" size

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Matrix "BYTES" size

Lucas
Dear R people.
I´m 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´m 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´t
define as integer (L)
The data that I´ll 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´ll appreciate if you can help me.

Thank you.
Lucas

        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Matrix "BYTES" size

Mercier Eloi
See ?sparseMatrix from package Matrix.

Eloi

On 12-05-07 02:23 PM, Lucas wrote:

> Dear R people.
> I´m 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´m 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´t
> define as integer (L)
> The data that I´ll 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´ll appreciate if you can help me.
>
> Thank you.
> Lucas
>
> [[alternative HTML version deleted]]
>
>
>
> ______________________________________________
> [hidden email] 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.

--
Eloi Mercier
Bioinformatics PhD Student, UBC
Paul Pavlidis Lab
2185 East Mall
University of British Columbia
Vancouver BC V6T1Z4


        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Matrix "BYTES" size

jholtman
In reply to this post by Lucas
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 <[hidden email]> 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]]
>
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Loading...