wtf-rstats
wtf-rstats copied to clipboard
Cannot retrieve user environment
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] ""
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?