rinstall.packages

Failed to download mirror file - R (version 3.5)


I facing problem to install any package in R programming language.

 install.packages("nnet")

After hitting enter to run the above code, getting the following:

Installing package into `‘C:/Users/Acer/Documents/R/win-library/3.4’`
(as ‘lib’ is unspecified)

--- Please select a CRAN mirror for use in this session ---
Warning: failed to download mirrors file `(cannot open URL 'https://cran.r-project.org/CRAN_mirrors.csv');` using local file `'C:/PROGRA~1/R/R-34~1.2/doc/CRAN_mirrors.csv'`

> Warning: unable to access index for repository
> https://ftp.iitm.ac.in/cran/src/contrib:   cannot open URL
> 'https://ftp.iitm.ac.in/cran/src/contrib/PACKAGES' Warning: unable to
> access index for repository
> https://ftp.iitm.ac.in/cran/bin/windows/contrib/3.4:   cannot open URL
> 'https://ftp.iitm.ac.in/cran/bin/windows/contrib/3.4/PACKAGES' Warning
> messages:

    1: In download.file(url, destfile = f, quiet = TRUE) :
      InternetOpenUrl failed: 'The connection with the server was reset'
    2: package ‘nnet’ is not available (for R version 3.4.2) 

I am not able to fix the problem. Can anyone help me on this issue, please?


Solution

  • Try running as an Administrator. I need to run RGui as administrator to install a package (on Windows 10 using RGui 4.3.1).

    Everything else works without admin access, but apparently accessing the folders where the packages are stored needs admin access.