Help regarding package installation: .Renviron, .Rprofile, R_LIBS, R_LIBS_SITE, and R_LIBS_USER Oh my!

Thanks for all the help everyone!

It seems that the R HOME directory is different from the windows HOME directory. Using the FAQ Q2.14 I decided to create an R_USER environment variable in my system settings located in the windows control panel:

Control Panel > System and Security > System > Advanced System settings > Environment Variables
I set the R_USER = C:\Users\Greg\Software

When I closed and reopened r and installed packages they were installed to:
C:\Users\Greg\Software\R\win-library\3.5

The output from .libPaths() is
[1] "C:/Users/Greg/Software/R/win-library/3.5" "C:/Program Files/R/R-3.5.1/library"

This is exactly what I wanted. If you recognize anything wrong with this approach please let me know, otherwise I hope this helps others who ran into this problem on windows!

4 Likes