[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  EnvVar: Environment Variables

##  Description

Details of some of the environment variables which affect an  R  session.

##  Arguments

##  Unix-specific

Some variables set on Unix-alikes, and not (in general) on Windows.

` DISPLAY ` :

    

Optional: used by ` [ X11 ](/link/X11?package=base&version=3.6.2) ` , Tk (in
package  tcltk  ), the data editor and various packages.

` EDITOR ` :

    

The path to the default editor: sets the default for ` [ options
](/link/options?package=base&version=3.6.2) ("editor") ` when namespace  utils
is loaded.

` PAGER ` :

    

The path to the pager with the default setting of ` [ options
](/link/options?package=base&version=3.6.2) ("pager") ` . The default value is
chosen at configuration, usually as the path to ` less ` .

` R_PRINTCMD ` :

    

Sets the default for ` [ options ](/link/options?package=base&version=3.6.2)
("printcmd") ` , which sets the default print command to be used by ` [
postscript ](/link/postscript?package=base&version=3.6.2) ` .

` R_SUPPORT_OLD_TARS `

    

logical. Sets the default for the ` support_old_tars ` argument of ` [ untar
](/link/untar?package=base&version=3.6.2) ` . Should be set to ` TRUE ` if an
old system ` tar ` command is used which does not support either ` xz `
compression or automagically detecting compression type.

##  Windows-specific

Some Windows-specific variables are

` GSC ` :

    

Optional: the path to Ghostscript, used if ` R_GSCMD ` is not set.

` R_USER ` :

    

The user's ‘home’ directory. Set by  R  . ( ` HOME ` will be set to the same
value if not already set.)

` TZDIR ` :

    

Optional. The top-level directory of the time-zone database. See ` [
Sys.timezone ](/link/Sys.timezone?package=base&version=3.6.2) ` .

##  Details

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).

` HOME ` :

    

The user's ‘home’ directory.

` LANGUAGE ` :

    

Optional. The language(s) to be used for message translations. This is
consulted when needed.

` LC_ALL ` :

    

(etc) Optional. Use to set various aspects of the locale -- see ` [
Sys.getlocale ](/link/Sys.getlocale?package=base&version=3.6.2) ` . Consulted
at startup.

` MAKEINDEX ` :

    

The path to ` makeindex ` . If unset to a value determined when  R  was built.
Used by the emulation mode of ` [ texi2dvi
](/link/texi2dvi?package=base&version=3.6.2) ` and ` [ texi2pdf
](/link/texi2pdf?package=base&version=3.6.2) ` .

` R_BATCH ` :

    

Optional -- set in a batch session, that is one started by ` R CMD [ BATCH
](/link/BATCH?package=base&version=3.6.2) ` . Most often set to ` "" ` , so
test by something like ` !is.na( [ Sys.getenv
](/link/Sys.getenv?package=base&version=3.6.2) ("R_BATCH", NA)) ` .

` R_BROWSER ` :

    

The path to the default browser. Used to set the default value of ` [ options
](/link/options?package=base&version=3.6.2) ("browser") ` .

` R_COMPLETION ` :

    

Optional. If set to ` FALSE ` , command-line completion is not used. (Not used
by the macOS GUI.)

` R_DEFAULT_PACKAGES ` :

    

A comma-separated list of packages which are to be attached in every session.
See ` [ options ](/link/options?package=base&version=3.6.2) ` .

` R_DOC_DIR ` :

    

The location of the  R  ` doc ` directory. Set by  R  .

` R_ENVIRON ` :

    

Optional. The path to the site environment file: see [ Startup
](/link/Startup?package=base&version=3.6.2) . Consulted at startup.

` R_GSCMD ` :

    

Optional. The path to Ghostscript, used by ` [ dev2bitmap
](/link