Skip to content
Prev 1866 / 398506 Next

Transferring data from S+ to R

On Thu, 14 Jan 1999, Zivan Karaman wrote:

            
R version? I'll assume rw0631.

You could try

In S-PLUS

dump(ls(), "dirdump", T)

in R (having set a large enough workspace)

source("dirdump")
save.image()

This is not guaranteed to work: R is not S and for example S objects can
have storage modes not supported in R, and the functions may not be valid
R, but it will give you a start and you can edit the file dirdump to
change such things, as it will be a text file in the S language.

Remember that source will not work unless the file is entirely correct:
you may see more of what is going on by using rterm and a batch file
(details in the V&R R complements).

The same ideas work for the reverse transfer: in R you need

dump(ls(all.names=T), "dirdump")

but if the help page is up-to-date `the implementation of dump is very
incomplete'.