Windows 7/10: If your C:\Program Files
(or wherever R is installed) is blocked for writing, as mine is, then you'll get frustrated editing RProfile.site
(as I did). As specified above, I updated R_LIBS_USER
and it worked. However, even after reading the fine manual several times and extensive searching, it took me several hours to do this. In the spirit of saving someone else time...
Let's assume you want your packages to reside in C:\R\Library
:
C:\R\Library
Start
--> Control Panel
--> User Accounts
--> Change my environmental variables
Environmental Variables
window pops up. If you see R_LIBS_USER
, highlight it and click Edit
. Otherwise click New
. Both actions open a window with fields for Variable
and Value
.R_LIBS_USER
was already there, and the value was a path to my desktop. I added to the path the folder that I created, separated by semicolon as mentioned above. C:\R\Library;C:\Users\Eric.Krantz\Desktop\R stuff\Packages
. NOTE: I could have removed the path to the Desktop location and simply left C:\R\Library
.