Jagdeesh R
Jagdeesh R

Reputation: 41

R Package installation Issue

I'm not able to install any packages in R. I tried in all versions of R starting from 3.2.2 till 3.2.4(revised), but I get the same error. It seems like a proxy issue to me as I'm connected to my college firewall. I was able to install the packages when I'm connected to my home network. Can you please guide me to resolve this issue.? Here are the error messages

> chooseCRANmirror()
Error in download.file(url, destfile = f, quiet = TRUE) : 
  cannot open URL 'https://cran.r-project.org/CRAN_mirrors.csv'
In addition: Warning message:
In download.file(url, destfile = f, quiet = TRUE) :
  InternetOpenUrl failed: 'The server name or address could not be resolved'
> install.packages("ggplot2")
Installing package into ‘C:/Users/HP/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository https://cran.rstudio.com/src/contrib
Warning: unable to access index for repository 
Warning: unable to access index for repository 
Warning: unable to access index for repository 
Warning message:
package ‘ggplot2’ is not available (for R version 3.2.2)

Upvotes: 2

Views: 17906

Answers (6)

user3005814
user3005814

Reputation:

To fix:

  • Uncheck the 'use secure download method' checkbox in Rstudio global options.
  • Restart internet then restart Rstudio

Upvotes: 0

harichandana
harichandana

Reputation: 1

utils:::menuInstallPkgs() --- Please select a CRAN mirror for use in this session --- 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' Error in install.packages(NULL, .libPaths()[1L], dependencies = NA, type = type) : no packages were specified

Upvotes: -2

mehdi sarparast
mehdi sarparast

Reputation: 1

you can reset and restore your internet connection (for windows and your default explorer),The problem will be solved.

Upvotes: 0

basit
basit

Reputation: 198

Simply use HTTP mirror instead of HTTPS ones. To change mirror go to "Packages menu" -> "Set CRAN mirror" -> "(HTTP mirrors)" -> select any

Upvotes: 4

Jagdeesh R
Jagdeesh R

Reputation: 41

Thanks for your valuable feedback guys. The solution to this problem drove me crazy. I have set my proxy settings according to my college network in MOZILLA, however, I have not set the same for IE. I guess, R downloads the packages based on IE settings, which was not configured. After setting the proxy to connect to the internet, I was able to download the packages without any issues.

Figured this out after trying all your solutions, but at last it was this silly thing that worked.

Thanks for all your time and suggestions.

Upvotes: 0

Himanshu Rai
Himanshu Rai

Reputation: 188

This is the same problem I was also facing while installing any packages. The main reason what I think is that your R session can't connect to the files path on Cran server.

What I did was just manually go to the Cran website and download the windows release for that particular package. Now unzip the files and manually paste the folder into your library folder of R.

The library folder path will be something like this: C:\Program Files\R\R-3.2.3\library

Now go to your R console and load it with library(package name). You can now use your package.

Upvotes: 5

Related Questions