[R] Problem setting options(error=recover) in my Rprofile.site

Prof Brian D Ripley ripley at stats.ox.ac.uk
Thu Sep 14 18:28:34 CEST 2006


On Thu, 14 Sep 2006, Marcus, Jeffrey wrote:

> I'd like to be able to set options(error=recover) in my Rprofile.site file.
> When I do this I get the message
> "Error in options(error = recover) : object "recover" not found
>
> I assume this is because the utils package (where recover and dump.frames
> are defined) has not been loaded at the time I make this call.
>
> I suppose I could explicitly do library("utils") before setting the
> "options" even though it will be loaded again when the default packages are
> loaded.

It will not be loaded again.

> Any simpler suggestions of how to get options(error=recover) set
> automatically every time I start R?

options(error=utils::recover)

> More generally, is there a way to have code executed on startup but *after*
> the default packages are loaded?

Load the default packages yourself in your startup code, by calling 
.First.sys() (and resetting it to avoid the slight overhead of subsequent 
require() calls if you want).

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