0

I just got a new Macbook, and I've downloaded R and Rstudio. But for some reason, I can't install any packages in R studio. It all shows the same error:

Warning in install.packages :
  unable to access index for repository http://cran.rstudio.com/src/contrib:
  cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES'

I've tried to check R options, but it seems alright:

getOption("download.file.method") [1] "libcurl"

I've also unchecked the "Use secure download method for HTTP" option under Tools -> Global Options -> Packages. and my CRAN mirror is shown "Global (CDN) - RStudio"

and here's the version I'm using:

version _
platform x86_64-apple-darwin15.6.0
arch x86_64
os darwin15.6.0
system x86_64, darwin15.6.0
status
major 3
minor 5.3
year 2019
month 03
day 11
svn rev 76217
language R
version.string R version 3.5.3 (2019-03-11) nickname Great Truth

Warning in install.packages :
  unable to access index for repository https://cloud.r-project.org/src/contrib:
  cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES'
Warning in install.packages :
  unable to access index for repository https://www.stats.ox.ac.uk/pub/RWin/src/contrib:
  cannot open URL 'https://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES'

Even tho this is shown as a warning message only, but when I try to actually use this package, it pops a real error message as following:

> library(dplyr)
Error in library(dplyr) : there is no package called ‘dplyr’

And I've already turned off all firewalls on my Mac. I've search a lot of similar questions online, but seems like no real fix to it. Has anyone run into this error before? How did you fix it? Please send help! Thanks a lot!

S.J
  • 109
  • 2
  • 3
  • 11
  • This is a warning, not an error, and should not prevent package installation. See [this question and answer](https://stackoverflow.com/questions/45115975/problems-with-installation-r-packages) for some context. You should not need to be changing firewalls, HTTPS or anything else. – neilfws Apr 08 '19 at 22:15
  • Even tho this is shown as a warning message, but I'm not able to successfully install any packages. For example, I tried to install.packages("dplyr"), even tho it's showing a warning message, but when I use "library(dplyr)", it's showing an error message as "Error in library(dplyr) : there is no package called ‘dplyr’" – S.J Apr 09 '19 at 12:49

0 Answers0