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? Thanks Agus Dr. Agustin Lobo Instituto de Ciencias de la Tierra (CSIC) Lluis Sole Sabaris s/n 08028 Barcelona SPAIN tel 34 93409 5410 fax 34 93411 0012 alobo at ija.csic.es http://pangea.ija.csic.es/alobo -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Try using the S function "dump" rather than "data.dump". Many files can be transfered that way (data.dump and data.restore will appear in the next few months). R does not yet support attaching S .Data directories, but the format for S objects on disk appears to be pretty straightforward (except for lists) so we will probably eventually provide some way of grabbing data files directly from a .Data directory. +----------------------------------------------------------------------+ | Ross Ihaka Email: ihaka at stat.auckland.ac.nz | | Department of Statistics Phone: (64-9) 373-7599 x 5054 | | University of Auckland Fax: (64-9) 373-7018 | | Private Bag 92019 | | Auckland, New Zealand | +----------------------------------------------------------------------+ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._