![Qq player 2020](https://cdn1.cdnme.se/5447227/9-3/24_64e61dfd9606ee7f8b257167.png)
![rstudio install package rstudio install package](https://community.rstudio.com/uploads/default/original/3X/c/2/c23be7033f28b52ba383f5d615719e962c430009.png)
Modified file: if(!nzchar(Sys.getenv("R_LIBS_USER"))) Original file with: if(!nzchar(Sys.getenv("R_LIBS_USER")))
![rstudio install package rstudio install package](https://i.ytimg.com/vi/y23sf7_1nH4/maxresdefault.jpg)
The documentation that support this solution is here
![rstudio install package rstudio install package](https://community-cdn.rstudio.com/uploads/default/optimized/2X/b/ba330513399ebafdab371fded63a3825d5ac7cae_2_1035x582.png)
In my case, I replaced the this line file.path(Sys.getenv("R_USER"), "R", with file.path("~\target", "R". Edit the file and change the definition the variable R_LIBS_USER.In my case it was at C:\Program Files\R\R-3.3.3\library\base\R\Rprofile. Create the target destination folder for the libraries, e.g.,.The solution is editing the Rprofile file to overwrite the variable R_LIBS_USER which by default points to the home directory. (NOTE: In the last step, I could have removed the path to the Desktop location and simply left C:\R\Library).įacing the very same problem (avoiding the default path in a network) I came up to this solution with the hints given in other answers. C:\R\Library C:\Users\Eric.Krantz\Desktop\R stuff\Packages. I added to the path the folder that I created, separated by semicolon. In my case, R_LIBS_USER was already there, and Value was a path to my desktop.Both actions open a window with fields for Variable and Value. If you see R_LIBS_USER, highlight it and click Edit. The Environmental Variables window pops up.Click Start -> Control Panel -> User Accounts -> Change my environmental variables.Next I need to add this folder to the R_LIBS_USER path: Let's assume you want your packages to reside in C:\R\Library:
![rstudio install package rstudio install package](https://community.rstudio.com/uploads/default/optimized/3X/c/1/c1a62b5fa49663059c6589c50b1690fa8096e0a4_2_1024x575.png)
In the spirit of saving someone else time. However, even after reading the fine manual several times and extensive searching, it took me several hours to do this. As specified in the accepted answer, I updated R_LIBS_USER and it worked. 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).
![Qq player 2020](https://cdn1.cdnme.se/5447227/9-3/24_64e61dfd9606ee7f8b257167.png)