Work with Open Road Traffic Casualty Data from Great Britain
Overview
Work with and download road traffic casualty data from Great Britain. Enables access to the UK's official road safety statistics, 'STATS19'. Enables users to specify a download directory for the data, which can be set permanently by adding `STATS19_DOWNLOAD_DIRECTORY=/path/to/a/dir` to your `.Renviron` file, which can be opened with `usethis::edit_r_environ()`. The data is provided as a series of `.csv` files. This package downloads, reads-in and formats the data, making it suitable for analysis. See the stats19 vignette for details. Data available from 1979 to 2025. See the official data series at https://www.data.gov.uk/dataset/cb7ae6f0-4be6-4935-9277-47e5ce24a11f/road-accidents-safety-data. 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, Tait et al. (2023) doi:10.1016/j.aap.2022.106895, and León et al. (2025) doi:10.18637/jss.v114.i09 for examples of how the data can be used for methodological and empirical research.
- **Support for 2025 Data**: Full support for the newly published 2025 STATS19 casualty, vehicle, and collision dataset from the Department for Transport (fixes #315).
- **Documentation and Dataset Updates**: Updated dataset list, documentation, examples, and metadata for 1979-2025 coverage (fixes #315).
- **Citation Prompt on Attach**: Added package citation details (Lovelace et al. 2019) and
citation("stats19")instructions to the package startup message. - **Bug Fixes & Data Quality Improvements**:
- Preserved character class for alphanumeric collision indices, avoiding
NAcoercions (fixes #231). - Eliminated unmatched parser warnings during dataset loading (fixes #257).
- Ensured valid POSIXct
datetimecreation for midnight00:00timestamps (fixes #236). - Enhanced vehicle make cleaning rules for
Freight RoverandAustin Morris(fixes #296).
From NEWS.md in the release
Install
Health
- OK13 OK2026-09-08
- ERROR12 OK, 1 ERROR2026-09-07
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-08
Show 3 earlier changesHide 3 earlier changes
- ERROR12 OK, 1 ERROR2026-06-07
- OK12 OK2026-04-25
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 35
- Examples that run
- 36%9 run in a plain check (1 of them under a condition) · 13 only when donttest examples are enabled (R CMD check --as-cran) · 2 never run · 1 hold no code
- Exported functions with examples
- 77%
- Documented parameters
- 97%
- Return-value docs
- 12%
- Help pages citing references
- 0%
- stats19-intro HTML
- An introduction to road safety analysis with R: setup notes HTML
- duckdb-engine HTML
- Introducing stats19 HTML
- Make and model data in STATS19 HTML
- Reproducing Reported road casualties in Great Britain: pedestrian factsheet
- Researching vehicles involved in collisions with STATS19 data HTML
- Stats19 v4.0.0: Unified, Cleaned, and Faster Road Safety Data HTML
- stats19: a package for road safety research HTML
Downloads
Repository
- PRs merged (all time)
- 92%
- Median days to close, 50 most recently updated closed issues
- 1
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
14 development-tooling and community-health practices detected across 8 families in the upstream repository
Checks run against github.com/ropensci/stats19 on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-07-30
pkgdown site last built 2026-07-30, before release 4.1.0 (2026-07-31)
Show all practicesHide 4 practices
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen 2026-01-28Pull request: opened by its own accountCommits: at least 3 crediting it in the message
- Claude Codefirst seen 2026-07-31Named in .Rbuildignore: .claude
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 4.1.0Latest
- RR 4.6.0 released · 2026-04-24
- 4.0.02026-03-18 · diff ↗ ·
added 9 exports
clean_make, clean_make_model, clean_model, extract_make_stats19, get_url, locate_files, match_tag, select_file, set_data_directory - 3.4.0
- RR 4.5.0 released · 2025-04-11
- 3.3.12025-01-15 · diff ↗
- 3.3.02025-01-13 · diff ↗
- 3.2.02024-10-25 · diff ↗
- 3.1.02024-08-01 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 3.0.32024-02-09 · diff ↗
- 3.0.22023-11-05 · diff ↗
- 3.0.02023-10-12 · diff ↗ ·
removed 2 exports
format_accidents, read_accidentsadded 2 exports
format_collisions, read_collisions - RR 4.3.0 released · 2023-04-21
- 2.0.12022-11-17 · diff ↗
- RR 4.2.0 released · 2022-04-22
Show 19 earlier eventsHide 19 earlier events
- unarchivedReturned to CRAN2021-10-30
- 2.0.02021-10-30 · diff ↗
- archivedRemoved from CRAN2021-10-20check problems were not corrected in time
- 1.4.32021-07-21 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 1.4.1
- unarchivedReturned to CRAN2021-03-15
- 1.4.0
- archivedRemoved from CRAN2021-03-14check problems were not corrected in time
- 1.3.02020-10-01 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 1.2.0
- 1.1.02019-10-15 · diff ↗
- 1.0.02019-07-28 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 0.2.12019-04-03 · diff ↗
- 0.2.02019-02-15 · diff ↗
- 0.1.12019-01-18
- RR 3.5.0 released · 2018-04-23
Package metadata
- First published
- 2019-01-18
- Total releases
- 22 / 7 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 351 KB / 12 files
- Download size
- 3.0 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("stats19")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.21105/joss.01181.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.