【发布时间】:2014-09-06 11:45:03
【问题描述】:
操作系统- Windows 7
R 3.0.3 版
我在 R 控制台上输入的内容:
if(!file.exists("data")){dir.create("data")}
fileUrl <- "https://data.baltimorecity.gov/api/views/dz54-2aru/rows.xlsx?accessType=DOWNLOAD"
download.file(fileUrl,destfile="./data/cameras.xlsx",method="curl")
dateDownloaded <- date()
我在 R 控制台上得到了什么
警告信息:
1: running command 'curl "https://data.baltimorecity.gov/api/views/dz54-2aru/rows.xlsx?accessType=DOWNLOAD" -o "./data/cameras.xlsx"' had status 127
2: In download.file(fileUrl, destfile = "./data/cameras.xlsx", method = "curl") :
下载的退出状态非零
我怎样才能做到正确?
【问题讨论】:
-
这是一些“有趣”的格式。您至少可以使代码格式化吗? FWIW,粗体字体不会使内容更具可读性。
-
在此处尝试 RCurl:stackoverflow.com/questions/23028760/…
-
将
https更改为仅http并跳过download.file中的method="curl"。这并不总是有效,但该文件可以通过普通的 'olhttp获得。
标签: r