\HeaderA{EnvVar}{Environment Variables}{EnvVar}
\aliasA{DISPLAY}{EnvVar}{DISPLAY}
\aliasA{EDITOR}{EnvVar}{EDITOR}
\aliasA{environment variables}{EnvVar}{environment variables}
\aliasA{HOME}{EnvVar}{HOME}
\aliasA{LANGUAGE}{EnvVar}{LANGUAGE}
\aliasA{PAGER}{EnvVar}{PAGER}
\aliasA{R\_BATCH}{EnvVar}{R.Rul.BATCH}
\aliasA{R\_BROWSER}{EnvVar}{R.Rul.BROWSER}
\aliasA{R\_COMPLETION}{EnvVar}{R.Rul.COMPLETION}
\aliasA{R\_DOC\_DIR}{EnvVar}{R.Rul.DOC.Rul.DIR}
\aliasA{R\_DVIPSCMD}{EnvVar}{R.Rul.DVIPSCMD}
\aliasA{R\_GSCMD}{EnvVar}{R.Rul.GSCMD}
\aliasA{R\_HISTFILE}{EnvVar}{R.Rul.HISTFILE}
\aliasA{R\_HISTSIZE}{EnvVar}{R.Rul.HISTSIZE}
\aliasA{R\_INCLUDE\_DIR}{EnvVar}{R.Rul.INCLUDE.Rul.DIR}
\aliasA{R\_LATEXCMD}{EnvVar}{R.Rul.LATEXCMD}
\aliasA{R\_MAKEINDEXCMD}{EnvVar}{R.Rul.MAKEINDEXCMD}
\aliasA{R\_PAPERSIZE}{EnvVar}{R.Rul.PAPERSIZE}
\aliasA{R\_PDFLATEXCMD}{EnvVar}{R.Rul.PDFLATEXCMD}
\aliasA{R\_PDFVIEWER}{EnvVar}{R.Rul.PDFVIEWER}
\aliasA{R\_PLATFORM}{EnvVar}{R.Rul.PLATFORM}
\aliasA{R\_PRINTCMD}{EnvVar}{R.Rul.PRINTCMD}
\aliasA{R\_RD4DVI}{EnvVar}{R.Rul.RD4DVI}
\aliasA{R\_RD4PDF}{EnvVar}{R.Rul.RD4PDF}
\aliasA{R\_SHARE\_DIR}{EnvVar}{R.Rul.SHARE.Rul.DIR}
\aliasA{R\_TEXI2DVICMD}{EnvVar}{R.Rul.TEXI2DVICMD}
\aliasA{R\_UNZIPCMD}{EnvVar}{R.Rul.UNZIPCMD}
\aliasA{R\_ZIPCMD}{EnvVar}{R.Rul.ZIPCMD}
\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.  Those that set the defaults for
options are consulted only at startup (as are some of the others).
\describe{
\item[\code{HOME}:] The user's \sQuote{home} directory.
\item[\code{LANGUAGE}:] Optional.  The language(s) to be used for
message translations.  This is consulted when needed.
\item[\code{LC\_ALL}:] (etc) Optional.  Use to set various aspects of
the locale -- see \code{\LinkA{Sys.getlocale}{Sys.getlocale}}.  Consulted at startup.
\item[\code{R\_BATCH}:] Optional -- set in a batch session.
\item[\code{R\_BROWSER}:] The path to the default browser.  Used to
set the default value of \code{\LinkA{options}{options}("browser")}.
\item[\code{R\_COMPLETION}:] Optional.  If set to \code{FALSE},
command-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\_DOC\_DIR}:] The location of the \R{} \file{doc}
directory.  Set by \R.
\item[\code{R\_DVIPSCMD}:] The path to \code{dvips}.  Defaults to
the value of \env{DVIPS}, and if that is unset to a value
determined when \R{} was built.
Used by \code{R CMD Rd2dvi}, and at startup to set the default for
\code{\LinkA{options}{options}("latexcmd")}, used by
\code{\LinkA{help}{help}(offline = TRUE}.

\item[\code{R\_ENVIRON}:] Optional.  The path to the site environment
file: see \LinkA{Startup}{Startup}.  Consulted at startup.
\item[\code{R\_GSCMD}:] Optional.  The path to GhostScript, used by
\code{\LinkA{dev2bitmap}{dev2bitmap}}.
\item[\code{R\_HISTFILE}:] Optional.  The path of the history file:
see \LinkA{Startup}{Startup}.  Consulted at startup and when the history is
saved.
\item[\code{R\_HISTSIZE}:] Optional.  The maximum size of the history
file, in lines.  Exactly how this is used depends on the
interface.
For the \code{readline} command-line interface it takes effect
when the history is saved (by \code{\LinkA{savehistory}{savehistory}} or at the
end of a session).

\item[\code{R\_HOME}:] The top-level directory of the \R{}
installation: see \code{\LinkA{R.home}{R.home}}.  Set by \R.
\item[\code{R\_INCLUDE\_DIR}:] The location of the \R{} \file{include}
directory.  Set by \R.
\item[\code{R\_LATEXCMD}:] The path to \code{latex}. Defaults to
the value of \env{LATEX}, and if that is unset to a value
determined when \R{} was built.
Used by \code{R CMD Rd2dvi}, and at startup to set the default for
\code{\LinkA{options}{options}("latexcmd")}, used by
\code{\LinkA{help}{help}(offline = TRUE}.

\item[\code{R\_LIBS}:] Optional.  Used for initial setting of
\code{\LinkA{.libPaths}{.libPaths}}.
\item[\code{R\_LIBS\_SITE}:] Optional.  Used for initial setting of
\code{\LinkA{.libPaths}{.libPaths}}.
\item[\code{R\_LIBS\_USER}:] Optional.  Used for initial setting of
\code{\LinkA{.libPaths}{.libPaths}}.
\item[\code{R\_MAKEINDEXCMD}:] The path to \code{makeindex}.  Defaults
at startup to the value of \env{MAKEINDEX}, and if that is unset
to a value determined when \R{} was built.  Used by \code{R CMD Rd2dvi}.
\item[\code{R\_PAPERSIZE}:] Optional.  Use to set the default for
\code{\LinkA{options}{options}("papersize")}, e.g. used by
\code{\LinkA{pdf}{pdf}}, \code{\LinkA{postscript}{postscript}} and
\code{\LinkA{help}{help}(offline = TRUE)}.
\item[\code{R\_PDFLATEXCMD}:] The path to \code{pdflatex}.  Defaults
at startup to the value of \code{PDFLATEX}, and if that is unset
to a value determined when \R{} was built.  Used by \code{R CMD Rd2dvi}.
\item[\code{R\_PDFVIEWER}:] The path to the default PDF viewer.  Used
by \code{R CMD Rd2dvi}.
\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\_PROFILE}:] Optional.  The path to the site profile
file: see \LinkA{Startup}{Startup}.  Consulted at startup.
\item[\code{R\_RD4DVI}:] Options for \code{latex} processing of
\code{Rd} files.  Used by \code{R CMD Rd2dvi} and
\code{\LinkA{help}{help}(offline = TRUE)}.
\item[\code{R\_RD4PDF}:] Options for \code{pdflatex} processing of
\code{Rd} files.  Used by \code{R CMD Rd2dvi}.
\item[\code{R\_SHARE\_DIR}:] The location of the \R{} \file{share}
directory.  Set by \R. 
\item[\code{R\_TEXI2DVICMD}:] The path to \code{texi2dvi}. Defaults
to the value of \env{TEXI2DVI}, and if that is unset to a value
determined when \R{} was built.
Consulted at startup to set the default for
\code{\LinkA{options}{options}("texi2dvi")}, used by
\code{\LinkA{texi2dvi}{texi2dvi}} in package \pkg{tools}.

\item[\code{R\_UNZIPCMD}:] The path to \code{unzip}.  Sets the default
value for \code{\LinkA{options}{options}("unzip")}.
\item[\code{R\_ZIPCMD}:] The path to \code{zip}.
\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{Sys.timezone}{Sys.timezone}} for the system-specific
formats.  Consulted as needed.
\item[\code{no\_proxy}, \code{http\_proxy}, \code{ftp\_proxy}:] (and more).  Optional.  Settings for \code{\LinkA{download.file}{download.file}}:
see its help for further details.
}
\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 the default editor.
\item[\code{PAGER}:] The path to the default pager.
\item[\code{R\_PRINTCMD}:] Sets the default for
\code{\LinkA{options}{options}("printcmd")}, which sets the default print
command to be used by \code{\LinkA{postscript}{postscript}}.
}
\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}

