Set environment variables from a named character vector, and return the old
values of the variables, so they could be restored later.
Usage
set_envvar(vars)
Value
Old values of the variables (if not set, NA).
Arguments
vars
A named character vector of the form c(VARIABLE = VALUE).
If any value is NA, this function will try to unset the variable.
Details
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.