I am trying to utilize the withr package to incorporate it's features in my package. I am trying to use withr::local_envvar to set an environment variable in my package so that when the package is unloaded, the environment variable is also unset. I can not figure out how to do this from the withr's documentation.
It seems that this psuedocode should work
<new_item> <- <something>
withr::local_envvar(new = c(<new_environment_variable> = <new_item>), action = "replace"))
I think that I should be passing in something for the .local_envir parameter but I am not sure what I should send if I want the variable to unset when the package is unloaded.