Good day: Let's say that I have a data frame in S-Plus 2000 (Win98 version). I want to use the same data frame with R on another computer. Questions: 1) Can R read S-Plus data frames? Can S-Plus 2000 read R data frames? 2) How can i move the data frame between the two systems? Do I need to use dump()? Thank you. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Sat, 29 Apr 2000, Edward J. Czilli wrote:> Good day: > > Let's say that I have a data frame in S-Plus 2000 (Win98 version). > > I want to use the same data frame with R on another computer. > > Questions: > > 1) Can R read S-Plus data frames? Can S-Plus 2000 read R data > frames?No, no. The first is possible (S data frames are external objects, even if under S-PLUS 2000 they often have mapped names), but R objects only exist inside R workspaces. [Yes, I know they can be save-d, but they are saved as a workspace containing just one object.] Ross has talked about adding the ability for R to read S objects, but this would need to be done by someone who has seen the S specs and not the S code (and I have seen the code but not the specs: I have no idea if they are public knowledge).> 2) How can i move the data frame between the two systems? Do I > need to use dump()?I would use write.table and read.table. You could also use dump and source, but the output is hardly human-readable for data frames. I tend to kep all my datasets as text files anyway, so I can read them into any version of R or S. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
"Edward J. Czilli" wrote:> 1) Can R read S-Plus data frames? Can S-Plus 2000 read R data > frames?Export from R/S+ the data frame into an external text file, and import it to S+/R... Needed functions for data frames: write.table() and read.table()> 2) How can i move the data frame between the two systems? Do I > need to use dump()?See 1) Greets Diego Kuonen -- Diego Kuonen http://statwww.epfl.ch/people/kuonen WAP on http://WAP.lugo.ch SURF on http://www.LUGO.ch http://www.Statoo.ch Kya aap statooed hai? http://www.Statoo.com http://www.LinuxPlanet.ch Linux - The Ultimate Anti-Virus Software Why use Windows, since there is a door? (By fachat at galileo.rhein-neckar.de, Andre Fachat) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
"Edward J. Czilli" <ejczilli at umich.edu> writes:> Let's say that I have a data frame in S-Plus 2000 (Win98 version). > > I want to use the same data frame with R on another computer. > > Questions: > > 1) Can R read S-Plus data frames?No, not directly. The simplest thing to do is to dump the data frame from S-PLUS to an ASCII file and try to read that into R. Sometimes that will work. Sometimes there are complications with the way S-PLUS stores factors.> Can S-Plus 2000 read R data frames?The reverse route tends to work better. A file created by dump in R tends to be easier to read into S-PLUS.> 2) How can i move the data frame between the two systems? Do I > need to use dump()?That is probably the most effective way. For example, in R use > data(InsectSprays) > str(InsectSprays) `data.frame': 72 obs. of 2 variables: $ count: num 10 7 20 14 14 12 10 23 17 20 ... $ spray: Factor w/ 6 levels "A","B","C","D",..: 1 1 1 1 1 1 1 1 1 1 ... > dump("InsectSprays", file = "InsectSprays.q") If you start S-PLUS you should be able to use > source("InsectSprays.q") to retrieve a copy of the frame. For the list: When moving objects between computers in R one can use the R save format (.rda files) because they use a machine-independent representation. I believe the preferred way of doing this in S-PLUS is still to use the S-PLUS data.dump format. A good project for someone wanting to learn the internals of R would be to create an R function that reads the S-PLUS data.dump format. It would be a great advantage to use C code to read the file and create the R structures. Read the manual "Writing R Extensions" before trying to do this. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> Good day: > > Let's say that I have a data frame in S-Plus 2000 (Win98 version). > > I want to use the same data frame with R on another computer. > > Questions: > > 1) Can R read S-Plus data frames? Can S-Plus 2000 read R data > frames? >All the previous answers will do, if you want something more sophisticated, try StatDataML. All the stuff you need is available at omegahat.org, and ready to use for R. You'll need to adapt some things for S (the StatDataML code should work), but you'll need to compile the XML stuff.> 2) How can i move the data frame between the two systems? Do I > need to use dump()?once you have StatDataML running on both systems, this is a piece of cake :-) Torsten> > Thank you. > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._