【发布时间】:2019-07-24 20:03:42
【问题描述】:
操作系统:Win 7 64 位 RStudio 版本 1.1.463
根据获取和清理数据课程,我尝试使用 method = curl 下载 csv 文件:
fileUrl <- "https://data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD"
download.file(fileUrl, destfile = "./cameras.csv", method = "curl")
download.file 中的错误(fileUrl, destfile = "./cameras.csv", method = "curl") : 'curl' 调用具有非零退出状态
但是,method = libcurl 导致下载成功:
download.file(fileUrl, destfile = "./cameras.csv", method = "libcurl")
尝试网址 'https://data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD' 已下载 9443 字节
从 *http***s** 更改为 http 分别对 curl 和 libcurl 产生完全相同的结果。
是否可以按照课程通过method = curl 进行下载?
谢谢
【问题讨论】: