This might seem like a strange question but is there any way to compress an
R object (such as a matrix) and know its resulting size in bytes ?
Clearly, I could implement this in the following way (if x is my matrix):
zz <- gzfile(fname,"w");
write.table(x,zz);
close(zz);
file.info(fname)[,"size"];
However, I need to do this for hundreds of thousands of objects and the
overhead in terms of disk access due to the actual file creation is
prohibitive.
I guess, I would like a modified object.size() function that returns the
size of the compressed (e.g. gzip) version of the object.
Thanks!
Markus
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.