knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" ) require(webTRISr) require(pixiedust) require(magrittr)
A R package for the WebTRIS Traffic Flow API, from Highways England.
Feedback and contributions welcome - please raise an issue or pull request.
install.packages('webTRISr')
or
install.packages('devtools') devtools::install_github('departmentfortransport/webTRISr')
Reports can be downloaded, as data frames, using webtris_report()
webtris_report(sites=c('7', '24'), start_date = '01012017', end_date = '01022017', report_type = 'monthly-summary')
x <- webtris_report(sites=c('7', '24'), start_date = '01012017', end_date = '01022017', report_type = 'monthly-summary') x[] %>% dust() %>% sprinkle(cols=1, halign = "left") %>% sprinkle_print_method("markdown")
All reports currently provided by the API are availble by changing the report_type
argument. At present these options are: "daily", "annual-totals", "annual-monthly", "monthly-summary", "monthly-daily", "monthly-daily-aggregate", and "monthly-hourly-aggregate".
webtris_areas()
head(webtris_areas()) %>% dust() %>% sprinkle(cols=1, halign = "left") %>% sprinkle_print_method("markdown")
webtris_sites()
head(webtris_sites())%>% dust() %>% sprinkle(cols=1, halign = "left") %>% sprinkle_print_method("markdown")
webtris_quality(siteID = '2', start_date = '01012017', end_date = '01022017')
head(webtris_quality(siteID = '2', start_date = '01012017', end_date = '01022017') )%>% dust() %>% sprinkle(cols=1, halign = "left") %>% sprinkle_print_method("markdown")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.