Re: R-alpha: saving workspace

George White (gwhite@cabot.bio.dfo.ca)
Mon, 10 Feb 97 12:13:01 AST


Message-Id: <199702101608.RAA19314@hypatia.math.ethz.ch>
From: George White <gwhite@cabot.bio.dfo.ca>
Subject: Re: R-alpha: saving workspace 
To: plummer@iarc.fr (Martyn Plummer)
Date: Mon, 10 Feb 97 12:13:01 AST
In-Reply-To: <199702101454.PAA18993@hypatia.math.ethz.ch>; from "Martyn Plummer" at Feb 10, 97 3:57 pm

> 
> At 14:14 10/02/97, pd@kubism.ku.dk wrote:
> 
> >Maybe I'm just going blind, but I can't seem to locate a command that
> >saves the workspace without terminating the current R session.
> 
> What about save(list=ls(),file=".RData.bak")? You can read the data back
> in with the load function. (I think you can even substitute .RData.bak for
> .RData)
> 
> >I probably won't need to expand on why that would be useful to have?
> Even more useful if it happened automatically.
> 

More generally, the range of things that can be done in R would be 
greater if there was a simple scheduling mechanism.  Is there a way
to have a specific function invoked just before the command prompt
returns after a function?  Such a function could be used to run
save(...) or check for various external cues (update of a file's
timestamp) to control an analysis.  

I doubt it would make sense to have full context switching in R,  but
perhaps save() could be done in a way that would allow it to be used
even in a long calculation under some timer control.  I expect the 
user would need to provide a list of the data objects that need to be 
saved.

--
  George N. White III                | Internet: <aa056@chebucto.ns.ca>
  Department of Fisheries and Oceans | DFO email: GWhite@BIOnet.BIO.DFO.ca
  Ocean Sciences Division            | Time Zone: Atlantic (AST4ADT)
  Bedford Institute of Oceanography  | phone: (08:00-16:00)
  P.O. Box 1006                      |     902.426.8509 (office)
  Dartmouth, Nova Scotia             |     902.426.9388 (FAX)
  CANADA               B2Y 4A2       |     902.426.3793 (emergencies)

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-