Skip to contents

Currently, there are 52 file names to download/read data from.

Usage

find_file_name(years = NULL, type = NULL)

Arguments

years

Year for which data are to be found

type

One of 'collisions', 'casualty' or 'vehicles' ignores case.

Examples

find_file_name(2016)
#> No files found. Check the stats19 website on data.gov.uk
#> character(0)
find_file_name(2016, type = "collision")
#> No files of that type found for that year.
#> No files found. Check the stats19 website on data.gov.uk
#> character(0)
find_file_name(1985, type = "collision")
#> No files of that type found for that year.
#> No files found. Check the stats19 website on data.gov.uk
#> character(0)
find_file_name(type = "cas")
#> [1] "dft-road-casualty-statistics-casualty-adjustment-lookup_2004-latest-published-year.csv"
#> [2] "dft-road-casualty-statistics-casualty-2022.csv"                                        
#> [3] "dft-road-casualty-statistics-casualty-1979-latest-published-year.csv"                  
#> [4] "dft-road-casualty-statistics-casualty-2021.csv"                                        
#> [5] "dft-road-casualty-statistics-casualty-2020.csv"                                        
#> [6] "dft-road-casualty-statistics-casualty-2019.csv"                                        
#> [7] "dft-road-casualty-statistics-casualty-2018.csv"                                        
#> [8] "dft-road-casualty-statistics-casualty-last-5-years.csv"                                
find_file_name(type = "collision")
#> [1] "dft-road-casualty-statistics-collision-adjustment-lookup_2004-latest-published-year.csv"
#> [2] "dft-road-casualty-statistics-collision-2022.csv"                                        
#> [3] "dft-road-casualty-statistics-collision-1979-latest-published-year.csv"                  
#> [4] "dft-road-casualty-statistics-collision-2021.csv"                                        
#> [5] "dft-road-casualty-statistics-collision-2020.csv"                                        
#> [6] "dft-road-casualty-statistics-collision-2019.csv"                                        
#> [7] "dft-road-casualty-statistics-collision-2018.csv"                                        
#> [8] "dft-road-casualty-statistics-collision-last-5-years.csv"                                
find_file_name(2016:2022) # warning when multiple years requested
#> Warning: argument 'pattern' has length > 1 and only the first element will be used
#> No files found. Check the stats19 website on data.gov.uk
#> character(0)