[R] load file RData which store in zip file

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Mar 29 12:42:29 CEST 2006

On Wed, 29 Mar 2006, Henrik Bengtsson wrote:

> Hi. R can do all of this for you. See ?save.image and especially the
> 'compress' argument.

It is nice to know that we anticipated your needs.  It is actually even 
easier.  If you do (using the Rtools or other sources, or on a Unix-alike)

gzip filename.RData
mv filename.RData.gz filename.RData

R will read the compressed file directly (you don't need to rename it, but 
it helps keep things tidy).

[As an aside, I wonder whether compress=TRUE should not be the default for 
binary save/save.image.  It adds little time and may save a lot of disc 

> /Henrik
> On 3/29/06, Muhammad Subianto <msubianto at gmail.com> wrote:
>> Dear R users,
>> My situation:
>> (1) I have limited workspace for my work harddisk (about 10 GiB).
>> (2) I have a lot of data files in R workspace (*.RData) which most of
>> them > 200 MiB. For some reason I zip some of them, for instance
>> "filename.RData (250 MiB)" to "filename.zip (3MiB)". In this work I
>> have a lot of more space of my harddisk.
>> Normally, If I want to use "filename.RData" for my experiment, I can
>> do it with load("filename.RData").
>> Then I tried to open/load
>>> load("filename.zip")
>> Error: bad restore file magic number (file may be corrupted) -- no data loaded
>> My question:
>> How can I open/load "filename.zip"? Is there any function to open R
>> workspace which it store in zip file? I hope some one can give me
>> advices.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list