[R] libraries in .First

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jun 3 18:35:58 CEST 2003


If this is R 1.7.0, the preferred mechanism is options("defaultPackages"), 
as in the following (from the examples in .First)

     # Example of Rprofile.site
     local({
       old <- getOption("defaultPackages")
       options(defaultPackages = c(old, "MASS"))
     })

.First is run too early to be loading packages.

Oh, and the preferred way to set the browser is environmental variable
R_BROWSER, usually in R_HOME/etc/Renviron{.site}.

On Tue, 3 Jun 2003, Laurie Sindlinger wrote:

> Dear all,
> 
>     I have a question regarding the .First function. I have included 
> help.start() and several libraries in my .First as:
> 
> .First <- function() {
> help.start(browser = "netscape7")
> library(lattice)
> library(modreg)
> library(splines)
> library(MASS)
> library(maps)}
> 
> The libraries maps and splines do not seem to be available when I start 
> R, but I have found if I change the order of the libraries in .First, 
> these libraries may be available and others may not. Has anyone had a 
> similar problem, or could anyone offer some suggestions? Thank you!
> 
> Laurie Sindlinger
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

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