Unable to run devtool, dplyr, gitthub, Rtools in R 4.0.2

I am working on a Probability and R Specialization course online, and the recommended version for R is 4.0.2. I installed it step by step, and began working on the project assigned. But devtools, the first package to be installed is not available for R Version 4.0.2.
I have installed RTools40 from CRAN but have been unable to run it in RStudio because it can't access it.
I tried creating a Renviron file but have been unable to run that too.
I am all out of options, and I have to move on in the course. Any help at all would be massively appreciated.

This comes up often among Win users. As shown in the linked posts, a variety of problems can occur.

While troubleshooting this, create a free RStudio Cloud account to be able to start your coursework.

After looking over the linked posts come back with any additional information about your setup that appears related.

Can you post the complete message you get when you try to install devtools?

Hi

Thank you for responding to my query.
So I enter the command- install.packages("devtools")
And this is what I get -

Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/src/contrib:
cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Installing package into ‘C:/Users/Sharma JI/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)

Adding the remaining command in the next message

I'm sending the response just for devtools, but I get the same message for other packages too-whether it's github, or dplyr or shiny.
I had, for the first time run RStudio through D:/ in my laptop, and the packages had installed then. After some commands weren't running as mentioned and I realized my error I uninstalled and reinstalled it via C:/ drive. It is now that none of the packages are loading.

  1. Warning in install.packages :
    unable to access index for repository https://cran.rstudio.com/src/contrib:
    cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
  1. Warning in install.packages :
    package ‘devtools’ is 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/4.0:
    cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/PACKAGES'

Also none of these packages are available in the packages index in the Files, either to install or update.

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.
  • Disable secure download setting.
  • 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.
2 Likes

4 posts were split to a new topic: I can't seem to find the knit option for my Rmd document in RStudio IDE?

This topic was automatically closed after 45 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.