Warning: unable to access index for repository htt

2019-02-06 14:45发布

问题:

This question already has an answer here:

  • Problems with installation R packages 2 answers

From today, every time I try to install a new package on R (3.4.1) with Rstudio 1.0.143 I receive this error message:

Warning: 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'

I change the CRAN mirror in Global options>packages but it still shows this error. The packages have started downloading from a different server than stats.ox.ac.uk but there is huge delay while R tries to connect to stats.ox.ac.uk. Is this a global problem, or just happening to me? If global, is there a workaround to stop this serror message from showing?

Thanks. Deep (Dwaipayan Adhya)

回答1:

I'm guessing this is a temporary issue (but an annoying one nonetheless and one that I dealt with this morning). That repository is most likely an additional one set alongside the "CRAN" repository as "CRANextra". The solution is to redefine the repos option to not include CRANextra. You can use the setRepositories() command and unselect "CRANextra". Alternatively you could just run the following code which will remove all repositories except the "CRAN" selection.

options(repos = getOption("repos")["CRAN"])


标签: r rstudio