使用带有R的https请求下载csv文件

使用带有R的https请求下载csv文件,r,csv,https,R,Csv,Https,我想使用https请求下载csv文件。 使用网络浏览器,我可以下载这个 我想在R做这件事。 我尝试使用RCurl包中的getURL函数,但没有成功 library(RCurl) URL <- "https://indices.euronext.com/nyx_eu_listings/price_chart/download_historical?typefile=csv&layout=vertical&typedate=dmy&separator=poin

我想使用https请求下载csv文件。 使用网络浏览器,我可以下载这个

我想在R做这件事。 我尝试使用RCurl包中的getURL函数,但没有成功

library(RCurl) URL <-
     "https://indices.euronext.com/nyx_eu_listings/price_chart/download_historical?typefile=csv&layout=vertical&typedate=dmy&separator=point&mic=XPAR&isin=FR0003500008&name=CAC%2040&namefile=Price_Data_Historical&from=0&to=1426550400000&adjusted=1&base=0"

csvfile <- getURL(URL)

library(RCurl)URL使用download.file然后read.table代替getURL:

URL <- "https://indices.euronext.com/nyx_eu_listings/price_chart/download_historical?typefile=csv&layout=vertical&typedate=dmy&separator=point&mic=XPAR&isin=FR0003500008&name=CAC%2040&namefile=Price_Data_Historical&from=0&to=1426550400000&adjusted=1&base=0"
        download.file(URL, "name.txt")
        data.url <- read.table("name.txt", skip= 3, sep=",", header=TRUE)

URL如果从
https
调用
getURL()?乍一看,这听起来可能有
SSH
问题。它不适用于download.file!错误消息是“URL不受支持”。下载.file(“,”name.txt“)或调用链接“link”。也许您有一个函数名与URL冲突。