R error: install.packages

I'm just trying to just install the package and it's all FUBAR. Worked well earlier this week. Didn't touch firewall settings or anything else and tried to install both "readxl" and "dplyr" (dplyr to check if there was a problem with the readxl package) on two separate machines on two separate networks, and the problem persists. Tried my home internet (both wifi and hardwire) as well as mobile hotspot on my cell phone. How can I get back to normal by downloading and installing packages quickly and easily?

> install.packages("readxl")
Warning in install.packages :
  InternetOpenUrl failed: 'A connection with the server could not be established'
Warning in install.packages :
  InternetOpenUrl failed: 'A connection with the server could not be established'
Warning in install.packages :
  InternetOpenUrl failed: 'A connection with the server could not be established'
Warning in install.packages :
  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'
Installing package into ‘C:/Users/grant/Documents/R/win-library/3.4
(as ‘lib’ is unspecified)
Warning in install.packages :
  InternetOpenUrl failed: 'The operation timed out'
Warning in install.packages :
  InternetOpenUrl failed: 'A connection with the server could not be established'
Warning in install.packages :
  InternetOpenUrl failed: 'The operation timed out'
Warning in install.packages :
  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'
Warning in install.packages :
  InternetOpenUrl failed: 'The operation timed out'
Warning in install.packages :
  InternetOpenUrl failed: 'A connection with the server could not be established'
Warning in install.packages :
  InternetOpenUrl failed: 'The operation timed out'
Warning in install.packages :
  unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.4:
  cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.4/PACKAGES'
trying URL 'http://cran.mtu.edu/bin/windows/contrib/3.4/readxl_1.0.0.zip'
Content type 'application/zip' length 1461628 bytes (1.4 MB)
downloaded 1.4 MB

package ‘readxl’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\grant\AppData\Local\Temp\Rtmpwb6TUN\downloaded_packages

      

@Kevin, I chose the Michigan CRAN mirror using selectCRANmirror, but install.packages still doesn't match the original bad mirror.

> chooseCRANmirror(local.only = TRUE)
Secure CRAN mirrors 

 1: 0-Cloud [https]                 2: Australia (Canberra) [https]    3: Australia (Melbourne) [https]
 4: Australia (Perth) [https]       5: Austria [https]                 6: Belgium (Ghent) [https]      
 7: Brazil (RJ) [https]             8: Brazil (SP 1) [https]           9: Bulgaria [https]             
10: Chile 1 [https]                11: China (Lanzhou) [https]        12: Colombia (Cali) [https]      
13: Czech Republic [https]         14: Denmark [https]                15: France (Lyon 1) [https]      
16: France (Lyon 2) [https]        17: France (Marseille) [https]     18: France (Montpellier) [https] 
19: France (Paris 2) [https]       20: Germany (Münster) [https]      21: Iceland [https]              
22: Indonesia (Jakarta) [https]    23: Ireland [https]                24: Italy (Padua) [https]        
25: Japan (Tokyo) [https]          26: Malaysia [https]               27: Mexico (Mexico City) [https] 
28: Norway [https]                 29: Philippines [https]            30: Russia (Moscow) [https]      
31: Spain (A Coruña) [https]       32: Spain (Madrid) [https]         33: Sweden [https]               
34: Switzerland [https]            35: UK (Bristol) [https]           36: UK (Cambridge) [https]       
37: UK (London 1) [https]          38: USA (CA 1) [https]             39: USA (KS) [https]             
40: USA (MI 1) [https]             41: USA (TN) [https]               42: USA (TX 1) [https]           
43: USA (TX 2) [https]             44: (other mirrors)                

Selection: 40
> install.packages("dplyr")
Warning in install.packages :
  InternetOpenUrl failed: 'A connection with the server could not be established'
Warning in install.packages :
  InternetOpenUrl failed: 'A connection with the server could not be established'
Warning in install.packages :
  InternetOpenUrl failed: 'A connection with the server could not be established'
Warning in install.packages :
  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'
Installing package into ‘C:/Users/grant/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
  InternetOpenUrl failed: 'A connection with the server could not be established'
Warning in install.packages :
  InternetOpenUrl failed: 'The operation timed out'
Warning in install.packages :
  InternetOpenUrl failed: 'The operation timed out'
Warning in install.packages :
  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'
Warning in install.packages :
  InternetOpenUrl failed: 'A connection with the server could not be established'
Warning in install.packages :
  InternetOpenUrl failed: 'A connection with the server could not be established'
Warning in install.packages :
  InternetOpenUrl failed: 'A connection with the server could not be established'
Warning in install.packages :
  unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.4:
  cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.4/PACKAGES'
trying URL 'https://cran.mtu.edu/bin/windows/contrib/3.4/dplyr_0.7.1.zip'
Content type 'application/zip' length 2881930 bytes (2.7 MB)
downloaded 2.7 MB

package ‘dplyr’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\grant\AppData\Local\Temp\RtmpQXhfjF\downloaded_packages

      

My CRAN mirror is up to date as well, but it doesn't seem to work even after restarting RStudio. Current CRAN mirror by default

***** Interim fix ***** This code should be run: a) after switching the default CRAN mirror and b) at the beginning of each session.

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

      

+3


source to share


2 answers


I faced the same problem and have been working on it all day. I tried several different CRAN mirrors and finally it worked:

install.packages ('readxl', dependencies = TRUE, repos = ' https://ftp.ussg.iu.edu/CRAN/ ')



Downloads happened instantly.

+1


source


Looks like a bug, with CRANextra mirror baked into RStudio options pointing to an unstable destination. RStudio is reportedly aware of the issue, confirms the bug and fixes the next version.

The default CRAN mirror must be changed first, then the temp solution must be executed at the start of each session.

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

      

Related posts:



Warning: Unable to access the index for the repository https://www.stats.ox.ac.uk/pub/RWin/src/contrib:

Problems with R installation packages

Thanks for your help narrowing down the problem, Kevin.

0


source







All Articles