Skip to content

import data from splus

3 messages · David James, Brian Ripley, Duncan Murdoch

#
hi,

I have a somewhat similar problem.  I also need to move huge, somewhat
complicated objects from Splus5 to R.  I need data.restore() in R 
(in my case it should be S4/Splus5 aware).

I took a quick look at the Rstream manual, but I didn't see anything that
I could easily use/modify for this problem (right?).

Is there something out there I could use, or will data.dump()/data.restore()
need to be written for R? (BTW I think this is not an R issue per se, but
rather an R-S interface issue -- it is a fact that most of my collaborators
use Splus.)

For the record,
_                           
platform i686-pc-linux-gnu           
arch     i686                        
os       linux-gnu                   
system   i686, linux-gnu             
status   Under development (unstable)
major    1                           
minor    2.0                         
year     2000                        
month    11                          
day      08                          
language R
David A. James
Statistics Research, Room 2C-253            Phone:  (908) 582-3082       
Bell Labs, Lucent Technologies              Fax:    (908) 582-3340
Murray Hill, NJ 09794-0636



------------- Begin Forwarded Message -------------
cc: r-help at stat.math.ethz.ch
Subject: Re: [R] import data from splus
MIME-Version: 1.0
On Mon, 13 Nov 2000, ximing wrote:

            
If that really will cost forever, then I think any route will take a long
time (and perhaps let that be a lesson not to store data in a proprietary
format).

You may find that the function readSdata in package Rstreams helps.
The normal route is to dump in S-PLUS and source in R.
#
On Tue, 14 Nov 2000, David James wrote:

            
readSfile could be modified (see later).
We are hoping to have a data.restore() S3-style.  Duncan Murdoch has
been working on one, hit a snag with blank lines that R-devel solves
(via readLines or even scan now).  (Duncan: where is this at?)

Our problem is that the only firm information we have is on S3-style dump
format, and that for vector and list objects with attributes.  If anyone
can extend this to a description of what S4 uses, we could maybe go
further.
#
On Tue, 14 Nov 2000 10:04:42 -0500 (EST), you wrote in message
<200011141504.KAA25758 at jessie.research.bell-labs.com>:
That may not be very easy at all.  There are differences between the
ways that R and S construct expressions and formulas; to work at the
level of the binary files or of data.dump, you'd need to first of all
understand how S stored expressions and translate that into the way R
stores them.

Why not just use "dump" and "source"?  They are more robust, because
they use the human-readable formats which are more often consistent
between the two systems.
I tried writing data.restore, and quit when I found there's no way to
read a blank line into a vector of strings.  You have to go to
external code, and that was just too much trouble at the time.

Duncan Murdoch
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._