[R] how to inspect content of save() file

Duncan Temple Lang duncan at wald.ucdavis.edu
Wed Apr 22 21:45:04 CEST 2009


Hi Benno et al.

  I have had some code for reading RDA files via R functions
and binary connections. It is available from

    http://www.omegahat.org/RDA

or
    install.packages("RDA", repos = "http://www.omegahat.org/R",
                       dep = TRUE)

It could be made faster if there is interest.

One of the motivations was to allow Spotlight on the mac
be able to index R files. In the future, I might create
an extended RDA format that puts the table of contents
at the end of the file and so we could look that up
directly as well as append new objects to the file.
And there are other good things we might do.
But we might be better off using a zip file as
a container for individually serialized objects. We
could deserialize these directly from the file without
having to unzip them.

   Anyway, hope this helps somewhat

     D.


Duncan Murdoch wrote:
> On 4/22/2009 12:59 PM, Benno Pütz wrote:
>> Am 22.Apr.2009 um 17:21 schrieb Dimitri Liakhovitski:
>>
>>> Why do you use save()?
>>> Can't you write out data frame(s) with your variables in a .txt or a
>>> .csv file and then read in just the variable names?
>>>
>> I could, but ...
>>
>>>>
>>>>
>>>>
>>>> As save() writes a binary (and by default compressed) format that  
>>>> is not
>>>>
>>
>> ... the files I look at now have a size of around 875MB (and this is  
>> after compression of the binary format) - text files (even 
>> compressed)  are usually bigger.
>>
>> But while this question arose from these files, it is the structure 
>> of  the files I am after.
> 
> It is not designed to be read bit-by-bit.  If you want to read only part 
> of the data, the only easy way is to write it in multiple files.
> 
> You can read the documentation for the format in the source (see 
> src/main/serialize.c), but I don't think it would be easy to put 
> together a function to do what you want.
> 
> Duncan Murdoch
> 
> ______________________________________________
> 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.




More information about the R-help mailing list