[R] S objects to R

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Thu Jul 15 13:16:13 CEST 1999

Agustin Lobo <alobo at ija.csic.es> writes:

> I've tried to move objects from S to R.
> In S+, I use data.dump() and data.restore().
> I've made a file all.dum using
> data.dump(ls()) in S+,
> but the R command 
> load("all.dum") gives an error:
> > load("/jaz/all.dum")
> Error: restore file corrupted -- no data loaded
> Is there any way to pass my objects from S+ to R?

Data.dump/restore is a bit too intimately linked with the internal
storage of objects in S to be directly portable to R. Somewhere on the
not-too-distant horizon I have plans to do a data.restore that can
handle the base types (vectors/factors/matrices/dataframes), but
functions and expressions are troublesome; even if it did work to
load them in, it is doubtful whether they would work afterwards... 

Currently, the best bet is to use dump() from S and source() the
resulting file in R. Some hand-editing may be required. Then just
save.image() from R. This may be slow and have some rather hefty
memory requirements if you have large objects, but hey, you only have
to do it once...

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
r-help 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: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list