Learn R Programming

fritools (version 4.6.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)

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.

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.

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: develop_test(), 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: clipboard_path(), file_copy(), file_save(), get_run_r_tests(), is_installed(), is_r_package_installed(), is_success(), is_windows(), view(), vim(), wipe_tempdir(), with_dir()

Examples

Run this code
message("See\n example(\"get_run_r_tests\", package = \"fritools\")")

Run the code above in your browser using DataLab