Skip to content
Prev 25973 / 63424 Next

RData File Specification?

Ian,
On Aug 23, 2007, at 4:21 PM, Cook, Ian wrote:

            
I don't think so - basically the sources are all the documentation  
I'm aware of. It's a bit messy, because R supports so many old formats.

However, if you want a stand-alone program that handles  
(uncompressed) XDR2 only, then I may have saved you a bit of work. I  
have a utility (based on the R sources) that allows you to scan  
through XDR2 files and to extract individual objects into a separate  
XDR2 file (this happens to be quite useful when you have a workspace  
that doesn't load into R and yet you want to save some pieces of it).  
Have a look at
http://urbanek.info/rdcopy.c

(you can either run it as "./rdcopy foo" to list the objects or "./ 
rdcopy foo -v" to show the full structure (all SEXPs with their  
offsets) or "./rdcopy foo bar 19" to copy SEXP at offset 19 from foo  
into a separate XDR2 file bar (use offset from the first call to copy  
entire objects).

It's not prefect, but servers its purpose (it resolves references by  
copying them instead of re-indexing, but it doesn't detect loops).  
Maybe it helps, even though the task you describe is still far from  
trivial.

Cheers,
Simon