Package: stats19 3.2.0

Robin Lovelace

stats19: Work with Open Road Traffic Casualty Data from Great Britain

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.

Authors:Robin Lovelace [aut, cre], Malcolm Morgan [aut], Layik Hama [aut], Mark Padgham [aut], David Ranzolin [rev], Adam Sparks [rev, ctb], Ivo Wengraf [ctb], RAC Foundation [fnd]

stats19_3.2.0.tar.gz
stats19_3.2.0.tar.gz(r-4.5-noble)stats19_3.2.0.tar.gz(r-4.4-noble)
stats19_3.2.0.tgz(r-4.4-emscripten)stats19_3.2.0.tgz(r-4.3-emscripten)
stats19.pdf |stats19.html
stats19/json (API)
NEWS

# Install 'stats19' in R:
install.packages('stats19', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/ropensci/stats19/issues

Datasets:

stats19road-safetytransportcar-crashesropenscidata

5.32 score 183 scripts 1.1k downloads 16 exports 37 dependencies

Last updated 5 days agofrom:3da419a2dc. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKOct 25 2024
R-4.5-linuxOKOct 25 2024

Exports:dl_stats19find_file_nameformat_casualtiesformat_collisionsformat_column_namesformat_pppformat_sfformat_vehiclesget_MOTget_stats19get_stats19_adjustmentsget_ULEZlocate_one_fileread_casualtiesread_collisionsread_vehicles

Dependencies:bitbit64classclassIntclicliprcpp11crayonDBIe1071fansigluehmsKernSmoothlifecyclemagrittrMASSpillarpkgconfigprettyunitsprogressproxyR6Rcppreadrrlangs2sftibbletidyselecttzdbunitsutf8vctrsvroomwithrwk

Introduction to R for road safety: an introduction to R and practical exercises

Rendered fromstats19-training.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2023-10-12
Started: 2019-10-15

Researching vehicles involved in collisions with STATS19 data

Rendered fromstats19-vehicles.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2024-10-24
Started: 2019-10-15

Introducing stats19

Rendered fromstats19.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2024-08-02
Started: 2019-01-17

An introduction to road safety analysis with R: setup notes

Rendered fromstats19-training-setup.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2023-10-12
Started: 2019-10-15

stats19: a package for road safety research

Rendered fromblog.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2024-08-02
Started: 2019-02-15

Readme and manuals

Help Manual

Help pageTopics
Sample of stats19 data (2022 collisions)accidents_sample accidents_sample_raw
Sample of stats19 data (2022 casualties)casualties_sample casualties_sample_raw
Local helper to be reused.check_input_file
Download STATS19 data for a yeardl_stats19
stats19 file names for easy accessfile_names file_names_old
Find file names within stats19::file_names.find_file_name
Format STATS19 casualtiesformat_casualties
Format STATS19 'collisions' dataformat_collisions
Format column names of raw STATS19 dataformat_column_names
Convert STATS19 data into ppp (spatstat) format.format_ppp
Format convert STATS19 data into spatial (sf) objectformat_sf
Format STATS19 vehicles dataformat_vehicles
Get data download dirget_data_directory
Download vehicle data from the DVSA MOT API using VRM.get_MOT
Download, read and format STATS19 data in one function.get_stats19
Download and read-in severity adjustment factorsget_stats19_adjustments
Download DVLA-based vehicle data from the TfL API using VRM.get_ULEZ
Convert file names to urlsget_url
Locate a file on disklocate_files
Pin down a file on disk from four parameters.locate_one_file
Generate a phrase for data download purposesphrase
Police force boundaries in England (2016)police_boundaries
Read in STATS19 road safety data from .csv files downloaded.read_casualties
Read in STATS19 road safety data from .csv files downloaded.read_collisions
Read in stats19 road safety data from .csv files downloaded.read_vehicles
Schema for stats19 data (UKDS)schema_original
Interactively select from optionsselect_file
Set data download dirset_data_directory
Stats19 schema and variablesstats19_schema stats19_variables
Sample of stats19 data (2022 vehicles)vehicles_sample vehicles_sample_raw