This function downloads UK road crash data.
It results in .csv files that are put
in a directory that can be set with get_data_directory()
.
By default, stats19 downloads files to a temporary directory.
You can change this behavior to save the files in a permanent directory.
This is done by setting the STATS19_DOWNLOAD_DIRECTORY
environment variable.
A convenient way to do this is by adding STATS19_DOWNLOAD_DIRECTORY=/path/to/a/dir
to your .Renviron
file, which can be opened with usethis::edit_r_environ()
.
The file downloaded would be for a specific year (e.g. 2022).
It could also be a file containing data for a range of two (e.g. 2005-2014).
The dl_*
functions can download many MB of data so ensure you
have a sufficient internet access and hard disk space.