Learn R Programming

fritools (version 3.3.0)

get_boolean_envvar: Get a Boolean Environment Variable

Description

A convenience wrapper to Sys.getenv.

Usage

get_boolean_envvar(x, stop_on_failure = FALSE)

Arguments

x

The name of the Environment Variable.

stop_on_failure

Throw an error instead of returning FALSE if the environment variable is not set or cannot be converted to boolean.

Value

The value the environment variable is set to, converted to boolean. FALSE if the environment variable is not set or cannot be converted to boolean. But see Arguments: stop_on_failure.

Details

As Sys.getenv seems to always return a character vector, the class of the value you set it to does not matter.

See Also

Other test helpers: get_run_r_tests(), is_cran(), is_r_cmd_check(), is_running_on_fvafrcu_machines(), is_running_on_gitlab_com(), run_r_tests_for_known_hosts(), set_run_r_tests()

Other operating system functions: file_copy(), file_save(), get_run_r_tests(), is_installed(), is_r_package_installed(), is_success(), is_windows(), view(), vim(), with_dir()

Examples

Run this code
# NOT RUN {
message("See\n example(\"get_run_r_tests\", package = \"fritools\")")
# }

Run the code above in your browser using DataLab