r - Error reading csv files from an URL in Markdown -
i trying download data bank of england website charts. use read.csv in script below , works fine when run in r console.
require(xts) require(performanceanalytics) url <- "http://www.bankofengland.co.uk/boeapps/iadb/fromshowcolumns.asp?csv.x=yes&datefrom=01/jan/1975&dateto=now &seriescodes=xudlusg,xudlerg&csvf=tn&usingcodes=y&vpd=y&vfd=n" datamat <- read.csv(url) datamat <- na.omit(datamat) rownames(datamat) <- as.date(datamat$date,format = "%d %b %y") datamat <- datamat[,2:3] datamat <- na.omit(as.xts(datamat)) chart.timeseries(datamat,main="")
however when trying generate report using markdown following error:
error in file(file, "rt") : cannot open connection calls: ... withvisible -> eval -> eval -> read.csv -> read.table -> file execution halted
the code use same above aside markdown
```{r getboedata } require(xts) require(performanceanalytics) url <- "http://www.bankofengland.co.uk/boeapps/iadb/fromshowcolumns.asp?csv.x=yes&datefrom=01/jan/1975&dateto=now &seriescodes=xudlusg,xudlerg&csvf=tn&usingcodes=y&vpd=y&vfd=n" datamat <- read.csv(url) datamat <- na.omit(datamat) rownames(datamat) <- as.date(datamat$date,format = "%d %b %y") datamat <- datamat[,2:3] datamat <- na.omit(as.xts(datamat)) chart.timeseries(datamat,main="") ```
Comments
Post a Comment