R - when trying to install package: InternetOpenUrl failed
The problem might be a failure to handle https
properly by the underlying method used by R for downloading files. This can be verified by trying
fname <- tempfile()
download.file("https://cran.uni-muenster.de/", destfile=fname)
file.remove(fname)
If that does not work but replacing https
with http
does, this most likely means that the method used by R's download.file
cannot deal with https
at all or fails verifying SSL certificates.
You can try
- using regular
http
mirrors instead ofhttps
- update your CA certificate bundle to allow proper certificate validation
setting the default download method to
"libcurl"
and see if that helps:options(download.file.method="libcurl")
Unable to install R packages for R 4.1
The issue was eventually solved by options(download.file.method="libcurl")
.
Following another suggested answer, I tried options(repos = "http://cran.rstudio.com/")
but got the below message:
Warning message:
In download.file(mirrors_csv_url, destfile = mirrors_csv, quiet = TRUE) :
InternetOpenUrl failed: 'ìÂs°þ$'
Then the answer to this question did the trick.
Related Topics
R Ggplot2: Stat_Count() Must Not Be Used with a Y Aesthetic Error in Bar Graph
How to Pass Dynamic Column Names in Dplyr into Custom Function
Dplyr - Group by and Select Top X %
Call by Reference in R (Using Function to Modify an Object)
Rounding Numbers in R to Specified Number of Digits
Rle-Like Function That Catches "Run" of Adjacent Integers
How to Extract Certain Columns from a List of Data Frames
Calling an R Function Using Inline and Rcpp Is Still Just as Slow as Original R Code
Purrr Map Equivalent of Nested for Loop
R Plotting Confidence Bands with Ggplot
How to Use a List as a Hash in R? If So, Why Is It So Slow
R Ggplot2: Labelling a Horizontal Line on the Y Axis with a Numeric Value
Join Two Data Frames in R Based on Closest Timestamp