Skip to content

libraries in .First

2 messages · Laurie Sindlinger, Brian Ripley

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