Dear R-Help, I've never had any trouble importing data into R until I had to import an .sdd file for a class. The file can be found here: http://www.math.umt.edu/steele/Math%20549/Farms.sdd. It begins with the line "## Dump S Version 4 Dump ##". I first attempted read.S which issued the message "not an S object". I then checked the Import/Export manual which seemed to indicate that data.restore might do the trick. Alas, it seems that function is trying to interpret the name of the data frame as an S mode or some such thing. Searched the archives (courtesy of Dr. Baron) and found this from Dr. Ripley: ".sdd files from S-PLUS 6.0 are S4 dumps, and will not work." This was written in 2002, is it still accurate? Right now my only obvious course of action is to get on a machine that has S+, read in this file and dump it in a more useful format. Are their others? Thanks so much, John P.S. I've been an R user for 4 years now and a subscriber to this list for almost that long. I'd just like to say an enormous thanks to everyone who contributes to the R project in some way. R is the most impressive realization of the free software movement I've ever seen. Particular thanks to the R core, those who publish the journal, and the authors of excellent and too-numerous-to-mention books on R and S. John Chandler-Pepelnjak Senior Analyst atlas DMT(tm) johnc at atlasdmt.com 206.816.8454 // direct 206.816.8909 // fax www.atlasdmt.com
John Chandler wrote:> Dear R-Help, > > I've never had any trouble importing data into R until I had to import > an .sdd file for a class. The file can be found here: > http://www.math.umt.edu/steele/Math%20549/Farms.sdd. It begins with the > line "## Dump S Version 4 Dump ##". I first attempted read.S which > issued the message "not an S object". I then checked the Import/Export > manual which seemed to indicate that data.restore might do the trick. > Alas, it seems that function is trying to interpret the name of the data > frame as an S mode or some such thing. > > Searched the archives (courtesy of Dr. Baron) and found this from Dr. > Ripley: ".sdd files from S-PLUS 6.0 are > S4 dumps, and will not work." This was written in 2002, is it still > accurate? Right now my only obvious course of action is to get on a > machine that has S+, read in this file and dump it in a more useful > format. Are their others? >Yes, it is still accurate. If you load the file in S-PLUS then do a data.dump with oldStyle = TRUE then you should be able to use data.restore in R quite easily. If you don't have access to S-PLUS I'm sure someone on this list (including myself) would be happy to do the conversion for you. --sundar
On Mon, 4 Oct 2004, John Chandler wrote:> Dear R-Help, > > I've never had any trouble importing data into R until I had to import > an .sdd file for a class. The file can be found here: > http://www.math.umt.edu/steele/Math%20549/Farms.sdd. It begins with the > line "## Dump S Version 4 Dump ##". I first attempted read.S which > issued the message "not an S object". I then checked the Import/Export > manual which seemed to indicate that data.restore might do the trick.That manual says otherwise.> Alas, it seems that function is trying to interpret the name of the data > frame as an S mode or some such thing. > > Searched the archives (courtesy of Dr. Baron) and found this from Dr. > Ripley: ".sdd files from S-PLUS 6.0 are > S4 dumps, and will not work." This was written in 2002, is it still > accurate?Yes. It's right there on the help page for data.restore, twice! It is also in the `R Data Import/Export Manual' you cited.> Right now my only obvious course of action is to get on a > machine that has S+, read in this file and dump it in a more useful > format. Are their others?Not that I have ever heard of, at least not open to those who have no access to S4 source code. Whereas the S3 dump format has been disclosed, I don't believe that the S4 one has. If this is an S4 class then you really want a dump of it, as R's internal representation is not at all like S4's, I believe. -- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
John Chandler wrote:> Dear R-Help, > > I've never had any trouble importing data into R until I had to import > an .sdd file for a class. The file can be found here: > http://www.math.umt.edu/steele/Math%20549/Farms.sdd. It begins with the > line "## Dump S Version 4 Dump ##". I first attempted read.S which > issued the message "not an S object". I then checked the Import/Export > manual which seemed to indicate that data.restore might do the trick. > Alas, it seems that function is trying to interpret the name of the data > frame as an S mode or some such thing. > > Searched the archives (courtesy of Dr. Baron) and found this from Dr. > Ripley: ".sdd files from S-PLUS 6.0 are > S4 dumps, and will not work." This was written in 2002, is it still > accurate? Right now my only obvious course of action is to get on a > machine that has S+, read in this file and dump it in a more useful > format. Are their others? >The S Version 4 dump format is described, somewhat briefly, in my "Programming with Data", pp 234-241. It would not be particularly hard to write a "reader" for the format, but as far as I know, this has not been done. Whether it's a good idea to read these dumps into R would depend on what data is stored there. For reasonably simple objects, the format is pretty obvious & the results would likely be fine. As the objects get more complicated, it's unlikely that the format will contain enough infomation, without the definition of the classes of the objects, to recreate them in R. The purpose of the data dump was to generate a portable & fully general dump for objects--"portable" however meaning between machines running the same system (with the same class definitions). In particular, if the objects were generated from a formally defined ("S4") class, the object as dumped will not give you much of a clue without the definition of the class. Nor, for that matter, will the ordinary dump() output, but that at least may be re-executable, once you have the correct class definition. In either case, you would need to get the S-language definition of the class. John Chambers