"dump" Splus -> R
Gregory R. Warnes
Wed, 31 Mar 1999 14:17:40 -0800 (PST)
A couple of comments for core...
In my examples, it looks like the only calls that need to be evaluated
inside the structure are "c()" and "list()". A heuristic approach for
loading the dump files, is to assume that any other call ought to be
returned as a call, rather than evaluated. Providing an undump() command
with this behavour might make it easier for people to move data between
Splus and R.
On Wed, 31 Mar 1999, Gregory R. Warnes wrote:
GRW>> Hi All,
GRW>> I just used "dump" on Splus to transfer a pile of survival objects from
GRW>> Splus 3.4 on Solaris 7 to R 0.63.3 on Intel.
GRW>> The only trick is that survival objects contain an element holding the
GRW>> original call that generated the object. When Splus writes these out, it
GRW>> doesn't mark them in any way, so when R tries to read them in, it ends up
GRW>> trying to reevaluate the call. Not nice.
GRW>> Anyway, as all but one** of the offending calls occur in statements
GRW>> that look like
GRW>> "blah" <- structure( [...], call = func( param1, param2, [...], )
GRW>> class = "myclass" [...] )
GRW>> so I wrote the following perl script to encapsulate each call in
GRW>> as.call(expression(...)) :
GRW>> -------begin translate.dump.pl--------
GRW>> print $_;
GRW>> ---------end translate.dump.pl----------
GRW>> Now the data can be transfered by :
GRW>> Splus on Unix:
GRW>> > dump(ls())
GRW>> Downloading the resulting "dumpdata" file.
GRW>> Linux shell:
GRW>> $ translate.dump.pl < dumpdata > dumpdata.fixed
GRW>> R on Linux:
GRW>> > source("dumpdata.fixed")
GRW>> Just thought this might help someone out...
GRW>> **The only exception was the ".Last.warning" object, which contained
GRW>> something like
GRW>> structure( "Warning Message" = offending(call) )
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: email@example.com