Search Docs by Keyword
R and RStudio on Windows
R packages in RStudio are user-based and not installed globally to all users.
To install packages in RStudio, you simply
This will install a package in a user library, something like
If you are using a secure system and the library cannot be downloaded, check that you have the correct proxies:
> Sys.getenv("http_proxy") > Sys.getenv("https_proxy")
If those variables are empty, set them with:
> Sys.setenv(http_proxy="http://rcproxy.rc.fas.harvard.edu:3128") > Sys.setenv(https_proxy="http://rcproxy.rc.fas.harvard.edu:3128")
Then, try installing again.
If a windows pops and asks for which mirror to download from, choose “cloud” otherwise the installation will fail.
Alternatively, you can permanently set your CRAN mirror to cloud by going to Tools -> Global Options -> Packages. On the “Management” tab, Primary CRAN repository, click “Change”. Under “Custom” type https://cloud.r-project.org/. Click OK, OK. You will have to restart RStudio for this change to take effect.