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] "dftRoadSafety_Accidents_2016.zip" #> [2] "dftRoadSafetyData_Vehicles_2016.zip" #> [3] "dftRoadSafetyData_Casualties_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 and other variables may be unreliable in these datasets.
#> See https://github.com/ropensci/stats19/issues/101 and https://github.com/ropensci/stats19/issues/102
#> [1] "Stats19-Data1979-2004.zip"
find_file_name(type = "cas")
#> [1] "DfTRoadSafety_Casualties_2019.zip" #> [2] "accident-and-casualty-adjusted.zip" #> [3] "dftRoadSafetyData_Casualties_2017.zip" #> [4] "dftRoadSafetyData_Casualties_2016.zip" #> [5] "DfTCasualtyDashboard.zip" #> [6] "RoadSafetyData_Casualties_2015.zip" #> [7] "DfTRoadSafety_Casualties_2009.zip" #> [8] "DfTRoadSafety_Casualties_2011.zip" #> [9] "DfTRoadSafety_Casualties_2010.zip" #> [10] "DfTRoadSafety_Casualties_2012.zip" #> [11] "DfTRoadSafety_Casualties_2013.zip" #> [12] "DfTRoadSafety_Casualties_2014.zip" #> [13] "dftRoadSafetyData_Casualties_2018.csv"
find_file_name(type = "accid")
#> [1] "DfTRoadSafety_Accidents_2019.zip" #> [2] "accident-and-casualty-adjusted.zip" #> [3] "dftRoadSafetyData_Accidents_2017.zip" #> [4] "dftRoadSafety_Accidents_2016.zip" #> [5] "RoadSafetyData_Accidents_2015.zip" #> [6] "DfTRoadSafety_Accidents_2009.zip" #> [7] "DfTRoadSafety_Accidents_2010.zip" #> [8] "DfTRoadSafety_Accidents_2011.zip" #> [9] "DfTRoadSafety_Accidents_2012.zip" #> [10] "DfTRoadSafety_Accidents_2013.zip" #> [11] "DfTRoadSafety_Accidents_2014.zip" #> [12] "dftRoadSafetyData_Accidents_2018.csv"
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_Accidents_2017.zip" #> [2] "dftRoadSafetyData_Casualties_2017.zip" #> [3] "dftRoadSafetyData_Vehicles_2017.zip" #> [4] "dftRoadSafety_Accidents_2016.zip" #> [5] "dftRoadSafetyData_Vehicles_2016.zip" #> [6] "dftRoadSafetyData_Casualties_2016.zip"