[R] Two R sessions?

David Brahm brahm at alum.mit.edu
Wed Apr 3 18:51:57 CEST 2002

Paul Y. Peng <ypeng at math.mun.ca> wrote:
> I wonder in R how do you handle one difference between R and S+.  S+ saves
> objects as different files in .Data directory while R saves all objects in
> a big file .RData.

In both S+ and R, I treat objects in the workspace (pos=1) as disposable, and
objects in attached databases (pos>1) as permanent.  I wrote the R package
"g.data" to store these permanent objects in separate files as S+ does:

"g.data" only loads the objects you actually use, so you don't have to read a
huge .RData file if you only want a small subset of the data.  Give it a try!

> ..I can start two S+ sessions from the same directory and work simultaneously
> as long as new objects in the two sessions are not in the same names.

This strikes me as dangerous, especially since I have so many "x" and "y"
variables all over.  Multiple sessions in R are much nicer, since I never store
my workspace and so there is never any interference.  No need to worry about
what working directory I started R up in.
                              -- David Brahm (brahm at alum.mit.edu)
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