withr (version 1.0.0)

with_envvar: Environment variables

Description

Temporarily change system environment variables.

Usage

with_envvar(new, code, action = "replace")

Arguments

new
[named character] New environment variables
code
[any] Code to execute in the temporary environment
action
should new values "replace", "prefix" or "suffix" existing variables with the same name.

Value

  • [any] The results of the evaluation of the code argument.

Details

if NA is used those environment variables will be unset. If there are any duplicated variable names only the last one is used.

See Also

withr for examples

Sys.setenv