wtf-rstats icon indicating copy to clipboard operation
wtf-rstats copied to clipboard

Cannot retrieve user environment

Open caseywross opened this issue 2 years ago • 1 comments

During the class activity, I was unable to retrieve the user level environment variable.

usethis::edit_r_environ("user")
#> • Edit '/Users/caseyross/.Renviron'
#> • Restart R for changes to take effect

In the .Renviron file I typed:

WTF_USER=CaseyRoss

But then I get an empty character when trying to retrieve it

Sys.getenv("user")
#> [1] ""

The project level setting worked when I was troubleshooting with David, but now it is also returning an empty character. David suspected that the space in my "Data Science" folder name may be causing the trouble.

usethis::edit_r_environ("project")
✔ Setting active project to '/Users/caseyross/Data Science/personal-radmin'
#> • Modify '.Renviron'
#> • Restart R for changes to take effect
WTF_PROJECT=CaseyRoss
Sys.getenv("project")
#> [1] ""

caseywross avatar Jul 26 '22 13:07 caseywross

Thank you for reporting @caseywross! I believe this is due to the confusion of .Renviron files not being additive between user and project. Does that make sense now?

shannonpileggi avatar Jul 26 '22 13:07 shannonpileggi