\HeaderA{EnvVar}{Environment Variables}{EnvVar}
\aliasA{environment variables}{EnvVar}{environment variables}
\keyword{utilities}{EnvVar}
\begin{Description}\relax
Details of some of the environment variables which affect an \R{} session.
\end{Description}
\begin{Details}\relax
It is impossible to list all the environment variables which can
affect an \R{} session: some affect the OS system functions which \R{}
uses, and others will affect add-on packages.  But here are notes on
some of the more important ones.
\describe{
\item[\code{HOME}:] The user's \sQuote{home} directory.
\item[\code{LANGUAGE}:] Optional.  The language(s) to be used for
message translations.
\item[\code{LC\_ALL}:] (etc) Optional.  Use to set various aspects of
the locale -- see \code{\LinkA{Sys.getlocale}{Sys.getlocale}}.
\item[\code{R\_BATCH}:] Optional -- set in a batch session.
\item[\code{R\_COMPLETION}:] Optional.  If set to \code{FALSE},
comand-line completion is not used.  (Not used by Mac OS GUI.)
\item[\code{R\_DEFAULT\_PACKAGES}:] A comma-separated list of packages
which are to be loaded in every session.  See \code{\LinkA{options}{options}}.
\item[\code{R\_ENVIRON}:] Optional.  The path to the site environment
file: see \LinkA{Startup}{Startup}.
\item[\code{R\_GSCMD}:] Optional.  The path to GhostScript.
\item[\code{R\_HISTFILE}:] Optional.  The path of the history file:
see \LinkA{Startup}{Startup}.
\item[\code{R\_HISTSIZE}:] Optional.  The maximum size of the history
file, in lines.
\item[\code{R\_HOME}:] The top-level directory of the \R{}
installation.  Set by \R.
\item[\code{R\_LIBS}:] Optional.  Setting for \code{\LinkA{.libPaths}{.libPaths}}.
\item[\code{R\_LIBS\_SITE}:] Optional.  Setting for \code{\LinkA{.libPaths}{.libPaths}}.
\item[\code{R\_LIBS\_USER}:] Optional.  Setting for \code{\LinkA{.libPaths}{.libPaths}}.
\item[\code{R\_PAPERSIZE}:] Optional.  The default papersize,
e.g. for \code{\LinkA{pdf}{pdf}} and \code{\LinkA{postscript}{postscript}}.
\item[\code{R\_PROFILE}:] Optional.  The path to the site profile
file: see \LinkA{Startup}{Startup}.
\item[\code{R\_RD4DVI}:] Options for \code{latex} processing of
\code{Rd} files.
\item[\code{R\_RD4PDF}:] Options for \code{pdflatex} processing of
\code{Rd} files.
\item[\code{TMPDIR}, \code{TMP}, \code{TEMP}:] Consulted (in that
order) when setting the temporary directory.  See
\code{\LinkA{tempdir}{tempdir}}.
\item[\code{TZ}:] Optional. The current timezone.  See
\code{\LinkA{as.POSIXlt}{as.POSIXlt}} for the system-specific formats.
\item[\code{no\_proxy}, \code{http\_proxy}, \code{ftp\_proxy}:] (and more).  Optional.  Settings for \code{\LinkA{download.file}{download.file}}.
}
\end{Details}
\begin{Section}{Unix-specific}
Some variables set on Unix-alikes, and not (in general) on Windows.
\describe{
\item[\code{DISPLAY}:] Optional: used by \code{\LinkA{X11}{X11}}, Tk (in
package \pkg{tcltk}), the data editor and various packages.
\item[\code{EDITOR}:] The path to default editor.
\item[\code{PAGER}:] The path to default pager.
\item[\code{R\_BROWSER}:] The path to default browser.
\item[\code{R\_DOC\_DIR}:] The location of the \R{} \file{doc} directory.
\item[\code{R\_DVIPSCMD}:] The path to \code{dvips}.
\item[\code{R\_INCLUDE\_DIR}:] The location of the \R{} \file{include}
directory.
\item[\code{R\_LATEXCMD}:] The path to \code{latex}.
\item[\code{R\_MAKEINDEXCMD}:] The path to \code{makeindex}.
\item[\code{R\_PDFVIEWER}:] The path to default PDF viewer.
\item[\code{R\_PLATFORM}:] The platform -- a string of the form
\code{\var{cpu}-\var{vendor}-\var{os}}, see \code{\LinkA{R.Version}{R.Version}}.
\item[\code{R\_PRINTCMD}:] Print command to be used by
\code{\LinkA{postscript}{postscript}}.
\item[\code{R\_SHARE\_DIR}:] The location of the \R{} \file{share}
directory. 
\item[\code{R\_UNZIPCMD}:] The path to \code{unzip}.
\item[\code{R\_ZIPCMD}:] The path to \code{zip}.
}
\end{Section}
\begin{SeeAlso}\relax
\code{\LinkA{Sys.getenv}{Sys.getenv}} and \code{\LinkA{Sys.setenv}{Sys.setenv}} to read and set
environmental variables in an \R{} session.
\end{SeeAlso}

