R version 3.0.1 (2013-05-16) for Windows 8 knitr
version 1.5 Rstudio 0.97.551
I am using knitr
to do the markdown of my R code.
As part of my analysis I downloaded various data sets from the web, knitr
is totally fine with getting data from http sites but from https ones where it generates an unsupported URL scheme
message.
I know when using the download.file
function on a mac the method
parameter has to be set to curl
to get data from an https however this doesn't help when using knitr
.
What do I need to do so that knitr
will gather data from Https websites?
Edit: Here is the code chunk that returns an error in Knitr but when run through R works without error.
```{r}
fileurl <- "https://dl.dropbox.com/u/7710864/data/csv_hid/ss06hid.csv"
download.file(fileurl, destfile = "C:/Users/xxx/yyy")
```
Using the R download package takes care of the quirky details typically associated with file downloads. For you example, all you needed to do would have been:
```{r}
library(download)
fileurl <- "https://dl.dropbox.com/u/7710864/data/csv_hid/ss06hid.csv"
download(fileurl, destfile = "C:/Users/xxx/yyy")
```
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With