0

I am trying to download a ZIP file in R and to extract a CSV. I've found a couple of solutions on StackOverFlow, e.g. Using R to Download and extract zip file that contains a folder,

but I am getting errors messages. My code:

url <- 'https://www.intervista.ch/media/2020/03/Download_Mobilit%C3%A4ts-Monitoring_Covid-19.zip'

temp <- tempfile()
download.file(url,temp)

Error output (translated from German):

Error in download.file(url, temp) : could not open URL 'https://www.intervista.ch/media/2020/03/Download_Mobilit%C3%A4ts-Monitoring_Covid-19.zip' Additional Warning: In download.file(url, temp) : URL 'https://www.intervista.ch/media/2020/03/Download_Mobilit%C3%A4ts-Monitoring_Covid-19.zip': status was 'SSL peer certificate or SSH remote key was not OK'

Machavity
  • 30,841
  • 27
  • 92
  • 100
Florian Seliger
  • 421
  • 4
  • 16

1 Answers1

1

It looks like you have an SSL problem which is usually a curl isse - Get site content over SSL with httr in R: Might try to follow those suggested solutions as the following code worked for me:

Modalsplit <- read.csv(unz(temp, "Modalsplit_pro_Tag.csv"))
Mittelwerte <- read.csv(unz(temp, "Mittelwerte_und_Median_pro_Tag.csv"))
Distanz <-read.csv(unz(temp, "Mittelwerte_und_Median_pro_Tag.csv"))
Chris
  • 266
  • 1
  • 6