Skip to content
Prev 43012 / 398506 Next

Restoring an S object that was data-dumped

On Tue, 20 Jan 2004 19:42:51 +0000 (GMT), Prof Brian Ripley
<ripley at stats.ox.ac.uk> wrote :
I developed the data.restore code that's there by recognizing that the
data.dump output was closely related to the binary format, which I had
reverse-engineered several years before.

I imagine there are a couple of possibilities to update it to the
newer format:

1.  We could approach Insightful, and find out if they'd give us specs
for the format.  They might be published somewhere, or they might be
willing to let us base our implementation on their data.restore
function.

This would need someone who knows who to contact at Insightful so as
to maximize the probability of a positive response.  

2.  We could reverse engineer the format.  This is probably easier
than you'd think.  It's just a matter of creating instances of all of
the kinds of objects that you want to be able to read, and seeing what
the dump looks like, and then trying out the procedure on a larger
body of data, and iterating a few times.

It's hopeless to think that many complex objects will ever be
recoverable this way (the internals of R are different than S-PLUS),
but it shouldn't be too hard to get vectors and data.frames, and maybe
functions.

Duncan Murdoch