Problems with installation R packages

Viewed 10389

I'm a Windows user. A few weeks ago I installed R and Rstudio along with many packages. Today there was a message that new packages were not installed.

Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/src/contrib:
  cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES'

I reinstalled R but this did not solve the problem.

Warning in install.packages :

  InternetOpenUrl failed: 'Can not connect to server'
3 Answers

I was facing similar issue and the fix that worked for me is that, in RStudio I've opened tools -> Global Options -> Packages -> Primary CRAN Repository -> Set Global.

Also make sure you're not using installed.packages this happens to a lot of people because of RStudio typing suggestions. You need to use install.packages("<package_name>")

Related