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

From: Prof Brian D Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu 14 Sep 2006 - 16:28:34 GMT

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

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri Sep 15 02:32:44 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 14 Sep 2006 - 18:30:05 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.