### This is the system Rprofile file. It is always run on startup.
### Additional commands can be placed in site or user Rprofile files
### (see ?Rprofile).

### Notice that it is a bad idea to use this file as a template for
### personal startup files, since things will be executed twice and in
### the wrong environment since user profiles are run in .GlobalEnv.

.GlobalEnv <- globalenv()
attach(NULL, name = "Autoloads")
.AutoloadEnv <- pos.to.env(2)
assign(".Autoloaded", NULL, env = .AutoloadEnv)
T <- TRUE
F <- FALSE
R.version <- structure(R.Version(), class = "simple.list")
version <- .Alias(R.version)            # for S compatibility
R.version.string <-
    paste(paste("R version",
                paste(version[c("major", "minor")], collapse = ".")),
          paste(version[c("year", "month","day")], collapse = "-"),
          sep=", ", collapse=" ")

.Machine <- Machine()
.Platform <- Platform()

options(na.action = "na.omit")
options(show.signif.stars = TRUE)
options(show.coef.Pvalues = TRUE)
options(keep.source = interactive())    # was `TRUE' in 1.0.x
options(warn = 0)
options(help.try.all.packages = FALSE)
options(CRAN = "http://cran.r-project.org")
options(timeout = 60)
options(download.info = 2)
options(encoding = native.enc)

.First <- function() {
    require("ctest", quietly=TRUE)
}

###-*- R -*- Unix Specific ----

.Library <- file.path(R.home(), "library")
.lib.loc <- unique(c(unlist(strsplit(Sys.getenv("R_LIBS"), ":")), .Library))
options(papersize = as.vector(Sys.getenv("R_PAPERSIZE")))
options(printcmd = as.vector(Sys.getenv("R_PRINTCMD")))
options(latexcmd = as.vector(Sys.getenv("R_LATEXCMD")))
options(dvipscmd = as.vector(Sys.getenv("R_DVIPSCMD")))
options(unzip = as.vector(Sys.getenv("R_UNZIPCMD")))
options(editor = as.vector(Sys.getenv("EDITOR")))
if(interactive() && Sys.getenv("DISPLAY") != "") {
    options(device = switch(.Platform$GUI,
            "X11" = "X11", "GNOME" = "gtk", "postscript"))
} else options(device = "postscript")
## this must be set for x11 to be used, even non-interactively
options(X11colortype = "true")
options(pager = "${R_HOME}/bin/pager")
options(browser = "netscape")
options(mailer = "mailx")

MacRoman <- as.integer(c(0:126, 32, 196, 197, 199, 201, 209, 214, 220,
225, 224, 226, 228, 227, 229, 231, 233, 232, 234, 235, 237, 236, 238,
239, 241, 243, 242, 244, 246, 245, 250, 249, 251, 252, 32, 176, 162,
163, 167, 32, 182, 223, 174, 169, 32, 146, 152, 32, 198, 216, 32, 177,
32, 32, 165, 181, 32, 32, 32, 32, 32, 170, 186, 32, 230, 248, 191, 161,
172, 32, 32, 32, 32, 171, 187, 32, 32, 192, 195, 213, 32, 32, 32, 32,
32, 32, 96, 39, 247, 32, 255, 32, 32, 32, 32, 32, 32, 32, 32, 183, 32,
32, 32, 194, 202, 193, 203, 200, 32, 32, 32, 32, 211, 212, 32, 210,
218, 219, 217, 144, 147, 148, 149, 150, 151, 154, 155, 157, 158, 159))

ISOLatin1 <- 0:255

WinAnsi <- as.integer(c(0:126, 32, 32, 32, 32, 32, 32, 32, 32, 32,
147, 32, 32, 32, 32, 32, 32, 32, 32, 96, 39, 32, 32, 32, 32, 32, 148,
32, 32, 32, 32, 32, 32, 32, 32, 161:255))
