Skip to content
Prev 15432 / 398500 Next

is auto-save possible?

The question of performing auto-saves every n commands goes back
several weeks, but hopefully the delay in responding is worthwhile.
The upcoming version 1.4.0 of R has a facility (addTaskCallback()q) by
which one can register a collection of functions that are invoked at
the end of each (successful) top-level expression.  This can be used
perform auto-saves, and other things such as updating GUI displays,
commiting changes to databases (i.e. transactions), validation of
objects, etc. One can even examine the expression that was just
evaluated and check if it was an assignment, or if it changed an important
variable that should be saved.

 There is a description of the mechanism at
  http://developer.r-project.org/TaskHandlers.pdf

Unlike other suggestions, I think doing auto-saves on the basis of
time is not the ideal approach. As others have pointed out, it relies
on the nature of the event loop which is neither portable or likely to
remain exactly the same.  After 1.4.0 is released, I plan to add
timers and readers/callbacks for connections and that will give
different features and also characteristics.

I hope the addTaskCallback() does what you want. 
 D.
Liaw, Andy wrote:

  
    
Message-ID: <20011204192503.G16986@jessie.research.bell-labs.com>
In-Reply-To: <51F9C42DA15CD311BD220008C707D81903DC839A@usrymx10.merck.com>; from andy_liaw@merck.com on Mon, Nov 12, 2001 at 03:52:45PM -0500