| Sys.getenv {base} | R Documentation |
Sys.getenv obtains the values of the environment variables named by
x.
Sys.getenv(x)
x |
a character vector, or missing |
A vector of the same length as x, with the variable names as
its names attribute. Each element holds the value of the
environment variable named by the corresponding component of x
(or "" if no environment variable with that name was found).
On most platforms Sys.getenv() will return a named vector giving
the values of all the environment variables.
Sys.putenv,
Sys.getlocale for the locale “environment”,
getwd for the working directory.
## whether HOST is set will be shell-dependent e.g. Solaris' csh does not.
Sys.getenv(c("R_HOME", "R_PAPERSIZE", "R_PRINTCMD", "HOST"))
str(s <- Sys.getenv()) # all settings (rather do not print)
## Language and Locale settings -- but rather use Sys.getlocale()
s[grep("^L(C|ANG)", names(s))]