Rev 9615 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{Startup}\title{Initialization at Start of an R Session}\usage{.First <- function() { \dots\dots }.Rprofile <startup file>}\alias{Startup}\alias{Rprofile}\alias{.Rprofile}\alias{.First}\description{In \R, the startup mechanism is as follows. If a file\file{.Renviron}, or failing that \file{~/.Renviron}, exists, it issourced, usually to set environmental variables. This is suppressedby the flag \code{--no-environ}. Then \R searches forthe site-wide startup profile unless the command line option\code{--no-site-file} was given. The name of this file is takenfrom the value of the \file{R\_PROFILE} environment variable. If thatvariable is unset, the default is \file{\$R\_HOME/etc/Rprofile}.Then, unless \code{--no-init-file} was given, \R searches for a filecalled \file{.Rprofile} in the current directory or in the user'shome directory (in that order) and sources it.It also loads a saved image from \file{.RData} if there is one(unless \code{--no-restore-data} was specified, or \code{--no-restore}).Finally, if a function \code{.First} exists, it is executed as\code{.First()}.The functions \code{.First} and \code{\link{.Last}} can be definedin the appropriate startup profiles or reside in \file{.RData}.The commands history is read from the file specified by theenvironment variable \code{R_HISTFILE} (default \code{.Rhistory})unless \code{--no-restore-history} was specified (or\code{--no-restore}).The command-line flag \code{--vanilla} implies \code{--no-init-file},\code{--no-restore}, \code{--no-restore} and \code{--no-environ}.}\seealso{\code{\link{.Last}} for final actions before termination.}\keyword{environment}