R.home(component = "home")
"home"
which gives the R home
directory, other known values are "bin"
, "doc"
,
"etc"
, "include"
, "modules"
and "share"
giving the paths to the corresponding parts of an R installation."modules"
and on Windows "bin"
is a
sub-architecture-specific location.On a Unix-alike, the constructed paths are based on the current
values of the environment variables R_HOME and where set
R_SHARE_DIR, R_DOC_DIR and R_INCLUDE_DIR (these are
set on startup and should not be altered).On Windows the values of R.home()
and R_HOME are
guaranteed not to contain spaces, switching to the 8.3 short form of
path elements if required. The value of R_HOME is set to use
forward slashes (since many package maintainers pass it unquoted to
shells, for example in Makefiles).
The R home directory is often referred to as R_HOME,
and is the value of an environment variable of that name in an R
session.
It can be found outside an R session by R RHOME
.