a problem in installing "usethis" package

Dear all
I try to install rtools after installing my R studio. After installing R tools (R-4 alpha), I installed devtools.
I try to load("devtools"), but "usethis" was necessary.
After installing "usethis 1.5.1", when I try to load it I have received this error message:

library(usethis)
Error: package or namespace load failed for ‘usethis’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘fs’
Warning: unable to access index for repository https://cran.rstudio.com/src/contrib:
cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'

Any help will be appreciated

It seems there is a problem with getting all the package versions in the correct state. This can happen occasionally, and probably the best way of dealing with that is to systematically install every package that causes a problem.

In your case it seems you should re-install fs:

install.packages("fs")

Keep installing all the packages you need until everything is resolved.

(One thing to look out for is that you don't accidentally have to R sessions open, e.g. multiple RStudio windows. A second R session will block your package installation process.)

1 Like

Dear Andrie
Thank you so much.
I do it according your advice, and finally I install R tools,

find_rtools()
[1] TRUE

But when I try to install some other packages automatically not manually by downloading their .zip file, I received this error.

install.packages("AER")
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'

Is there any way that I can solve this problem? its some how difficult to download all of the install dependencies manually.

Thanks

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

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.

Dear andresrcs
Thank you so much. I do it.