On Wed, 11 Nov 2009, Larry Hotchkiss wrote:
Hi,
I'm responding to the question about storage error, trying to read a 3000000 x
100 dataset into a data.frame.
I wonder whether you can read the data as strings. If the numbers are all one
digit, each cell would require just 1 byte instead of 8.
Um, no.
a<-rep("1",100000)
object.size(a)
400056 bytes
object.size(a)/length(a)
4.00056 bytes
They are character strings, not individual characters, so some overhead is
unavoidable. Even if all the strings are identical you need four bytes per
string, the same as if the data were read as integers.
-thomas
Thomas Lumley Assoc. Professor, Biostatistics
tlum...@u.washington.edu University of Washington, Seattle
______________________________________________
R-help@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.