Skip to contents

See the DfT's documentation on adjustment factors Annex: Update to severity adjustments methodology.

Usage

get_stats19_adjustments(
  data_dir = get_data_directory(),
  u = paste0("https://data.dft.gov.uk/road-accidents-safety-data/",
    "accident-and-casualty-adjustment-2004-to-2019.zip"),
  filename = "cas_adjustment_lookup_2019.csv",
  adj_folder = "adjustment-data"
)

Arguments

data_dir

Where sets of downloaded data would be found.

u

The URL of the zip file with adjustments to download

filename

The file name of the .csv file in the unzipped folder to read in

adj_folder

The folder name where R will look for the unzipped adjustment files

Examples

# \donttest{
if(curl::has_internet()) {
adjustment = get_stats19_adjustments()
}
#> Unzipped files from DfT can be found in the folder:
#> /tmp/Rtmpq2wbe8
#> accident-and-casualty-adjustment-2004-to-2019.zip
#> adjustment-data
#> bslib-33c323209347325cefaafdfebacdea0b
#> dft-road-casualty-statistics-accident-2017.csv
#> dft-road-casualty-statistics-accident-2019.csv
#> dft-road-casualty-statistics-casualty-2017.csv
#> dft-road-casualty-statistics-casualty-2018.csv
#> dft-road-casualty-statistics-vehicle-2017.csv
#> downlit
#> file8f2118e099e
#> file8f245da181
#> file8f256b3f64e
#> file8f26b8314b
#> file8f277cb8f0a
#> file8f27f8d77c4
#> file8f2d9df7aa
#> Rows: 3314737 Columns: 6
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (1): accident_index
#> dbl (5): Vehicle_Reference, Casualty_Reference, Adjusted_Serious, Adjusted_S...
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
# }