Download.file fails in RStudio

前端 未结 5 1938
忘了有多久
忘了有多久 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:04

    I have the same problem when I download a file in RStudio when using

    > source("http://www.statmethods.net/RiA/wmc.txt")
    Error in file(filename, "r", encoding = encoding) : 
      cannot open the connection
    In addition: Warning message:
    In file(filename, "r", encoding = encoding) :
      InternetOpenUrl failed: '安全频道支持出错'
    

    Then I try

    > options(download.file.method="libcurl", url.method="libcurl")
    > source("http://www.statmethods.net/RiA/wmc.txt")
    > wmc
    

    It worked

提交回复
热议问题