[R] S <-> R

Rolf Turner rolf at math.unb.ca
Wed Aug 25 19:45:35 CEST 2004

I'm puzzled by the discourse in this thread.  Briefly, dput() and
dget() seem to work just fine for me.

I tried

	> junk <- list(x=rnorm(20),y=sample(1:100,12,TRUE))
	> dput(junk,"junk.dat")

in Splus (Version 6.1.2 Release 2 for Sun SPARC, SunOS 5.6 : 2002)

and then in R

	> junk <- dget("junk.dat")

R version:

platform sparc-sun-solaris2.9
arch     sparc               
os       solaris2.9          
system   sparc, solaris2.9   
major    1                   
minor    9.1                 
year     2004                
month    06                  
day      21                  
language R

There were no complaints, and typing ``junk'' in the R window
and in the Splus window appeared to produce indentical results.

So what's the problem?


					Rolf Turner
					rolf at math.unb.ca

Tony Plate wrote:

> Have you tried following the advice in the R Data Import/Export manual?  It 
> suggests the following:
> >Function data.restore reads S-PLUS data dumps (created by data.dump) with
> >the same restrictions (except that dumps from the Alpha platform can also 
> >be read).
> >It should be possible to read data dumps from S-PLUS 5.x and 6.x written with
> >data.dump(oldStyle=T).
> -- Tony Plate
> At Wednesday 10:29 AM 8/25/2004, Zachary Skrivanek wrote:
> >Hello!  I would like to be able to read in list data objects in R/S
> >created in R/S.  (Ie R->S or S->R.)  I have tried 'dput' and 'dump' in S,
> >but neither of the created files could be read into R (with 'dget' nor
> >'source').  Is there any way that I can save a list object in S that can
> >be read into R?
> >
> >Sincerely,
> >Zachary Skrivanek, PhD
> >Research Scientist
> >Program Phase Statistics-Endocrine

More information about the R-help mailing list