I would like to read online data to R using download.file()
as shown below.
URL <- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv"
download.file(URL, destfile = "./data/data.csv", method="curl")
Someone suggested to me that I add the line setInternet2(TRUE)
, but it still doesn't work.
The error I get is:
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
Appreciate your help.
I've succeed with the following code:
Note that I've changed the protocol from https to http, since the first one doesn't seem to be supported in R.
Try following with heavy files
You can set global options and try-
For issue refer to link- https://stat.ethz.ch/pipermail/bioconductor/2011-February/037723.html