I am taking a Data Science course at Coursera using R. I installed version 4.0.2 of R for Windows 10 (x64), then R tools 40 and finally RStudio. Everything went well until I tried to install a package using the command: install.packages ("ggplot2")
I tried another command: install.packages (c ("devtools", "lme4"))
They all give the same error message, as shown below:
> install.packages(c("devtools", "lme4"))
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/src/contrib:
unable to open the URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing packages into ‘C:/Users/ricardo.rfflj/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/src/contrib:
unable to open the URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :
packages ‘devtools’, ‘lme4’ are not available (for R version 4.0.2)
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/3.4:
unable to open the URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/PACKAGES'
Warning: unable to access index for repository https://cran.rstudio.com/src/contrib:
unable to open the URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Has anyone been through this and know any solutions? Do I have to make any changes?
Yes, I do. I accessed this forum from the same ultrabook in which it is installed.
The strange thing is that I can install from the R console, but not from RStudio.
Strange is also the error message stating that I did not install Rtools, but I have already installed and followed all instructions on the site.
It is also reporting that this package is not available for this version.
It could be a proxy problem, but I checked and the proxy is turned off.
It seems you haven configured your PATH correctly, I would recommend going over the configuration instructions again. Anyway, the current error message you are seeing is not related to Rtools not being found, this seems like a connectivity issue, R is not being able to connect to the CRAN repository you have selected, these are some things to try.
Choose a different CRAN repository, RStudios repository is a good choice (http://cran.rstudio.com/) or you could choose one that is geographically closer to you.
Check if your internet connection has traffic restrictions of some kind, like a firewall, proxy server, etc. This is usually the case when you are at work or school.