相关疑难解决方法(0)

使用download.file()从HTTPS下载文件

我想用R读取在线数据,download.file()如下所示.

URL <- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv"
download.file(URL, destfile = "./data/data.csv", method="curl")
Run Code Online (Sandbox Code Playgroud)

有人向我建议我添加该行setInternet2(TRUE),但它仍然无效.

我得到的错误是:

Warning messages:
1: running command 'curl  "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv"  -o "./data/data.csv"' had status 127 
2: In download.file(URL, destfile = "./data/data.csv", method = "curl",  :
  download had nonzero exit status
Run Code Online (Sandbox Code Playgroud)

感谢您的帮助.

csv https r

30
推荐指数
4
解决办法
9万
查看次数

标签 统计

csv ×1

https ×1

r ×1