Based on answers from the community, there appear to be several ways that might solve this:
- From the official FAQ and support forums and this answer, you may have have a firewall or proxy issue that is blocking RStudio from connecting to the internet:
- Disable any firewalls
- Tools -> Global Options -> Packages and unchecking the "Use Internet Explorer library/proxy for HTTP" option and restart R (#1, #2, #3)
- Flag R with --internet2
- On CentOS it was suggested to try the following:
install.packages('package_name', dependencies=TRUE, repos='http://cran.rstudio.com/')
- Several answers suggest using an alternate mirror (#1, #2, #3):
- Preferences > General > Default working directory > Browse and switch your mirror from local/global (whichever is unchecked)
- On Windows you can start the application with
http_proxy=http://host:port/
:
"C:\Program Files\RStudio\bin\rstudio.exe" http_proxy=http://host:port/
- Shut down and restart. Needed after many of the above operations, and suggested standalone.