[R] dump.frames in non-interactive mode

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri May 7 22:19:51 CEST 2004


On Fri, 7 May 2004, Vadim Ogranovich wrote:

> recover() resorts to dump.frames() when called in non-interactive
> sessions. However dump.frames() still puts the dump into last.dump
> object and not into a file, which brings the question of how to get hold
> of the object once the session terminates.

This is discussed in the help file for dump.frames ...

     If 'dump.frames' is installed as the error handler, execution will
     continue even in non-interactive sessions. See the examples for
     how to dump and then quit.

> I guess the supposed answer is that last.dump is saved in .Rdata once R
> exits. However I find it more convenient on day-to-day basis to use
> --no-save --no-restore options and avoid .Rdata. So my question is how
> to best set a hook, in say .Rprofile, so that in non-interactive mode
> (and only in it) last.dump (and only it) will be saved in a file upon
> exit from R.

dump.frames has parameters to do exactly this.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list