Reputation: 215
I want to extract some data for a .csv online into R. So therefore Im doing this (Ive already created a dir called "data")
fileUrl <- "https://data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD"
download.file(fileUrl, destfile = "./data/cameras.csv", method="curl")
It gives the my following error however:
Warning messages:
1: running command 'curl "https://data.baltimorecity.gov/api/views/dz54- 2aru/rows.csv?accessType=DOWNLOAD" -o "./data/cameras.csv"' had status 127
2: In download.file(fileUrl, destfile = "./data/cameras.csv", method = "curl") download had nonzero exit status
And if I remove the method= "curl"
I get
Error in download.file(fileUrl, destfile = "./data/cameras.csv") :
unsupported URL scheme
Any thoughts on what goes wrong?
Upvotes: 1
Views: 1528
Reputation: 11
I also had this problem. Changing method = "curl" to method = "auto" worked for me.
Upvotes: 1
Reputation: 1
fileUrl <- "http://data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD"
download.file(fileUrl, destfile = "./data/cameras.csv",method="curl")
Upvotes: 0