Rhome

0th

Percentile

Return the R Home Directory

Return the Rhome directory, or the full path to a component of the Rinstallation.

Keywords
utilities
Usage
R.home(component = "home")
Arguments
component
As well as "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.
Details

The Rhome directory is the top-level directory of the Rinstallation being run.

The Rhome directory is often referred to as R_HOME, and is the value of an environment variable of that name in an Rsession. It can be found outside an Rsession by R RHOME.

Value

  • A character string giving the Rhome directory or path to a particular component. Normally the components are all subdirectories of the Rhome directory, but this need not be the case in a Unix-like installation.

    The value for "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 switched to the 8.3 short form of path elements if required and if the Windows service to do that is enabled. The value of R_HOME is set to use forward slashes (since many package maintainers pass it unquoted to shells, for example in Makefiles).

Aliases
  • R.home
  • R_HOME
Documentation reproduced from package base, version 3.3, License: Part of R @VERSION@

Community examples

Looks like there are no examples yet.