[R] Transferring data from S+ to R

Zivan Karaman zk at biocem.univ-bpclermont.fr
Thu Jan 14 16:24:09 CET 1999

Thanks to everyone for helpful suggestions.

I followed the proposed method, and besides the expected trouble (objects
of user-defined classes, and special objects as .Random.seed, last.warning,
last.dump, and .Last.value) the only other problem I run into was with "lm"
objects that were produced with the needed data frame attached, rather than
by providing it in "data" argument of "lm" function (probably bad practice

As a result of the experience, I've created the following function:

"export" <-
function(file = "s2r", classes = c("function", "data.frame", "list",
"matrix", "numeric", "character", "logical"))
	x <- row.names(objects.summary(data.class = classes))
	i <- match(c("last.dump", "last.warning", ".Last.fixed", ".Last.value",
".Random.seed"), x)
	i <- i[!is.na(i)]
	if(length(i) > 0)
		x <- x[ - i]
	dump(x, fileout = file)

It is self-explanatory; just note that providing NULL as the value for the
"classes" argument will give you all the objects, regardless of their

It has been used (I don't dare say tested) with S+ 3.3 and rw0631 only (and
with NT 4.0).

The method works for reasonably sized data: I was unable to transfer a 1000
x 500 matrix, since R ran out of memory (even with --nsize 1000000).

Thanks again.


Zivan Karaman
Limagrain Genetics Research, B.P. 115, 63203 Riom Cedex, France
Tel: +33 (0) 473 634 343     Fax: +33 (0) 473 634 345
E-mail: zivan.karaman at biocem.univ-bpclermont.fr
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

More information about the R-help mailing list