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

find_file_name(years = NULL, type = NULL)

Arguments

years

Years for which data are to be found

type

One of 'Accidents', 'Casualties', 'Vehicles'; defaults to 'Accidents', ignores case.

Examples

find_file_name(2016)
#> [1] "MakeModel2016.zip" #> [2] "dftRoadSafetyData_Casualties_2016.zip" #> [3] "dftRoadSafetyData_Vehicles_2016.zip" #> [4] "dftRoadSafety_Accidents_2016.zip"
find_file_name(2016, type = "Accidents")
#> [1] "dftRoadSafety_Accidents_2016.zip"
find_file_name(1985, type = "Accidents")
#> Year not in range, changing to match 1979:2004 data
#> No files of that type found for that year.
#> This will download 240 MB+ (1.8 GB unzipped).
#> Coordinates unreliable in this data.
#> [1] "Stats19-Data1979-2004.zip"
find_file_name(type = "cas")
#> [1] "dftRoadSafetyData_Casualties_2017.zip" #> [2] "dftRoadSafetyData_Casualties_2016.zip" #> [3] "DfTCasualtyDashboard.zip" #> [4] "RoadSafetyData_Casualties_2015.zip" #> [5] "DfTRoadSafety_Casualties_2009.zip" #> [6] "DfTRoadSafety_Casualties_2010.zip" #> [7] "DfTRoadSafety_Casualties_2011.zip" #> [8] "DfTRoadSafety_Casualties_2014.zip" #> [9] "DfTRoadSafety_Casualties_2013.zip" #> [10] "DfTRoadSafety_Casualties_2012.zip"
find_file_name(type = "accid")
#> [1] "dftRoadSafetyData_Accidents_2017.zip" #> [2] "dftRoadSafety_Accidents_2016.zip" #> [3] "RoadSafetyData_Accidents_2015.zip" #> [4] "DfTRoadSafety_Accidents_2011.zip" #> [5] "DfTRoadSafety_Accidents_2010.zip" #> [6] "DfTRoadSafety_Accidents_2009.zip" #> [7] "DfTRoadSafety_Accidents_2014.zip" #> [8] "DfTRoadSafety_Accidents_2013.zip" #> [9] "STATS19VehicleAccidentData2012MakeModel.zip" #> [10] "DfTRoadSafety_Accidents_2012.zip" #> [11] "STATS19VehicleAccidentData2011MakeModel.zip" #> [12] "STATS19VehicleAccidentData2010MakeModel.zip" #> [13] "STATS19VehicleAccidentData2009MakeModel.zip"
find_file_name(2006)
#> Year not in range, changing to match 2005:2014 data
#> [1] "Stats19_Data_2005-2014.zip"
find_file_name(2016:2017)
#> [1] "dftRoadSafetyData_Vehicles_2017.zip" #> [2] "dftRoadSafetyData_Casualties_2017.zip" #> [3] "dftRoadSafetyData_Accidents_2017.zip" #> [4] "MakeModel2016.zip" #> [5] "dftRoadSafetyData_Casualties_2016.zip" #> [6] "dftRoadSafetyData_Vehicles_2016.zip" #> [7] "dftRoadSafety_Accidents_2016.zip"