Download.file fails in RStudio

前端 未结 5 1916
忘了有多久
忘了有多久 2020-12-11 17:40
file<-tempfile(fileext=\".csv\")
download.file(url=\"ftp://pubftp.spp.org/Markets/DA/LMP_By_SETTLEMENT_LOC/2014/03/28/DA-LMP-SL-201403280100.csv\",destfile=file,m         


        
5条回答
  •  不思量自难忘°
    2020-12-11 18:00

    I had a similar issue using R's download.file in a for loop in RStudio. It would download the url for the first several links and then I'd get "InternetOpenUrl failed: 'The operation timed out'" for all subsequent downloads. I tried the the suggestion by sssheridan to unselect the Internet Explorer option in R global options which did not work. I also tried setInternet2(use=T) but this is no longer available in R.

    What worked for me was to remove the cache by including cacheOK = F as an argument in download.file. I think this is because I had previously hit the links that were timing out.

提交回复
热议问题