ID EN
System & OS

Rhome

R Base 3.6.2

Return the R home directory, or the full path to a component of the R installation.

Syntax

R
R.home(component = "home")

Arguments

Parameter Description
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.

Return Value

A character string giving the R home directory or path to a particular component. Normally the components are all subdirectories of the R home 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 no

Details

The R home directory is the top-level directory of the R installation being run. 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.

Examples

Example
R
# NOT RUN {
## These result quite platform dependently :
rbind(home = R.home(),
      bin  = R.home("bin")) # often a sub directory of 'home'
list.files(R.home("bin"))
# }

See Also

commandArgs()[1] may provide related information.