set_envvar | R Documentation |
Set environment variables from a named character vector, and return the old values of the variables, so they could be restored later.
set_envvar(vars)
vars |
A named character vector of the form |
The motivation of this function is that Sys.setenv()
does not
return the old values of the environment variables, so it is not
straightforward to restore the variables later.
Old values of the variables (if not set, NA
).
vars = xfun::set_envvar(c(FOO = "1234"))
Sys.getenv("FOO")
xfun::set_envvar(vars)
Sys.getenv("FOO")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.