with_envvar

0th

Percentile

Environment variables

Temporarily change system environment variables.

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

local_envvar(new, action = "replace", .local_envir = parent.frame())

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.

.local_envir

[environment] The environment to use for scoping.

Details

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

Value

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

See Also

withr for examples

Sys.setenv()

Aliases
  • with_envvar
  • local_envvar
Documentation reproduced from package withr, version 2.1.2, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.