Work with Open Road Traffic Casualty Data from Great Britain
Local helper to be reused.
Download STATS19 data for a year
Find file names within stats19::file_names.
Format STATS19 casualties
Format STATS19 'collisions' data
Format column names of raw STATS19 data
Convert STATS19 data into ppp (spatstat) format.
Format convert STATS19 data into spatial (sf) object
Format STATS19 vehicles data
Get data download dir
Download vehicle data from the DVSA MOT API using VRM.
Download and read-in severity adjustment factors
Download, read and format STATS19 data in one function.
Download DVLA-based vehicle data from the TfL API using VRM.
Convert file names to urls
Locate a file on disk
Pin down a file on disk from four parameters.
Generate a phrase for data download purposes
Read in STATS19 road safety data from .csv files downloaded.
Read in STATS19 road safety data from .csv files downloaded.
Read in stats19 road safety data from .csv files downloaded.
Interactively select from options
Set data download dir
Tools to help download, process and analyse the UK road collision data collected using the 'STATS19' form. The datasets are provided as 'CSV' files with detailed road safety information about the circumstances of car crashes and other incidents on the roads resulting in casualties in Great Britain from 1979 to present. Tables are available on 'colissions' with the circumstances (e.g. speed limit of road), information about 'vehicles' involved (e.g. type of vehicle), and 'casualties' (e.g. age). The statistics relate only to events on public roads that were reported to the police, and subsequently recorded, using the 'STATS19' collision reporting form. See the Department for Transport website <https://www.data.gov.uk/dataset/cb7ae6f0-4be6-4935-9277-47e5ce24a11f/road-safety-data> for more information on these datasets. The package is described in a paper in the Journal of Open Source Software (Lovelace et al. 2019) <doi:10.21105/joss.01181>. See Gilardi et al. (2022) <doi:10.1111/rssa.12823>, Vidal-Tortosa et al. (2021) <doi:10.1016/j.jth.2021.101291>, and Tait et al. (2023) <doi:10.1016/j.aap.2022.106895> for examples of how the data can be used for methodological and empirical road safety research.
Useful links