Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Sys.getenv_value

System Environment Variables


Description

System Environment Variables

Usage

Sys.getenv_value(name, raw = FALSE)

Arguments

name

variable name as a character string.

raw

logical that indicates if one should return the raw value or the convertion of any false value to FALSE.

Value

the value of the environment variable as a character string or NA is the variable is not defined at all.

Examples

# undefined returns FALSE
Sys.getenv_value('TOTO')
# raw undefined returns NA
Sys.getenv_value('TOTO', raw = TRUE)

Sys.setenv(TOTO='bla')
Sys.getenv_value('TOTO')

# anything false-like returns FALSE
Sys.setenv(TOTO='false'); Sys.getenv_value('TOTO')
Sys.setenv(TOTO='0'); Sys.getenv_value('TOTO')

# cleanup
Sys.unsetenv('TOTO')

pkgmaker

Development Utilities for R Packages

v0.32.2
GPL (>= 2)
Authors
Renaud Gaujoux [aut, cre]
Initial release
2020-10-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.