Learn R Programming

webTRISr

A R package for the WebTRIS Traffic Flow API, from Highways England.

Feedback and contributions welcome - please raise an issue or pull request.

Installation

install.packages('webTRISr')

or

install.packages('devtools')
devtools::install_github('RACFoundation/webTRISr')

Examples

Reports

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')
#> Fetched page 1 of approximately 10000 rows
MonthSiteIdADT24HourADT24HourLargeVehiclesPercentageAWT24HourAWT24HourLargeVehiclesPercentageADT18HourADT18HourLargeVehiclesPercentageAWT18HourAWT18HourLargeVehiclesPercentageADT16HourADT16HourLargeVehiclesPercentageAWT16HourAWT16HourLargeVehiclesPercentageADT12HourADT12HourLargeVehiclesPercentageAWT12HourAWT12HourLargeVehiclesPercentage
January 20177167111.1193812.3162310.4188311.5160110.4186011.5145410.2168611.4
February 20177185211.8211913.1180011206012.4177311203112.4161511184612.5
January 2017243713214.43994916.73554213.13819915.33442712.93708515.12907312.93136615.2
February 2017244052914.24270316.63880712.94082515.33756212.83959515.23153512.83311215.3

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".

Areas

webtris_areas()
IdNameDescriptionXLongitudeXLatitudeYLongitudeYLatitude
1A1 Darrington to Dishforth DBFOA1 Darrington to Dishforth DBFO-1.254871853.6827769-1.446163554.1543464
2A19 DBFOA19 DBFO-1.112365654.1535047-1.490683154.9749529
3A1M DBFOA1M DBFO-0.233960952.3604247-0.328372752.5347699
4A249 DBFOA249 DBFO0.772587351.32802540.660257351.4419403
5A30/A35 DBFOA30/A35 DBFO-2.211865950.6913012-3.465456450.8130964
6A417/A419 DBFOA417/A419 DBFO-1.717215151.5279008-2.16666751.8570205

Sites

webtris_sites()
IdNameDescriptionLongitudeLatitudeStatus
1MIDAS site at M4/2295A2 priority 1 on link 105009001; GPS Ref: 502816;178156; WestboundM4/2295A2-0.520379651.4930115Inactive
2MIDAS site at A1M/2259B priority 1 on link 126046101; GPS Ref: 514029;294356; SouthboundA1M/2259B-0.320275552.5351578Active
3MIDAS site at M5/7482B priority 1 on link 109001601; GPS Ref: 388120;253057; NorthboundM5/7482B-2.175138352.1756518Active
4MIDAS site at M3/2173A priority 1 on link 103009101; GPS Ref: 442770;118058; WestboundM3/2173A-1.392373750.9603586Active
5MIDAS site at M25/5764B priority 1 on link 199056702; GPS Ref: 558308;188775; Anti-clockwiseM25/5764B0.283161651.5756168Active
6MIDAS site at M27/9273A priority 1 on link 103009302; GPS Ref: 448516;111110; EastboundM27/9273A-1.311486150.8974292Active

Quality

webtris_quality(siteID = '2', start_date = '01012017', end_date = '01022017')
#> Warning: attributes are not identical across measure variables;
#> they will be dropped
DateQuality
1483228800100
1483315200100
1483401600100
1483488000100
1483574400100
1483660800100

Copy Link

Version

Install

install.packages('webTRISr')

Monthly Downloads

8

Version

0.2.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Ivo Wengraf

Last Published

August 7th, 2019

Functions in webTRISr (0.2.0)

webtris_sites

Sites
annual_totals_parser

Annual total parser
webtris_areas

Areas
webtris_quality

Quality
webtris_report

webtris_report