[R] Just a thought ...

John Logsdon j.logsdon at lancaster.ac.uk
Sun Sep 12 10:12:29 CEST 1999


Dear all

As someone who leaves his R session open for days - even longer - because
only I access the computer it is on, I very occasionally crash it (my most
recent success was to use a very long plot() which it turned out have both
'l' and a 'b' without keyword!).

I try to be careful, preserving essential bits of coding in an adjacent
emacs screen and doing save.image() from time to time but of course when
it crashes, you lose the data and structures.  S+ of course stores
everything as separate files, which always seems very wasteful but would
be useful for idiots like me!  However I don't have immediate access to
it and anyway it's my own fault.

However, in the eternal quest to improve R, would it be possible then to
have an option autosave that only worked when waiting for input (ie in
interactive mode)?

Something like (a crude version - perhaps better to use system facilities
like cron under *ix):

options(autosave=10)#Autosaves every 10 minutes or later

then in the code where *when awaiting input only* 

while (noinput){
  if(current.time()>=save.time){
    save.image('.Rautosave')
    save.time<-current.time()
  }
}

The >= would be necessary because R might be doing something at save.time
and by having the autosave check done only when doing nothing else would
save valuable clock cycles and possible confusion on restoring.  You
wouldn't want to tie up the processor unnecessarily so there are probably
better ways of doing this.

John

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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