read_casualties {stats19} | R Documentation |
Read in STATS19 road safety data from .csv files downloaded.
Description
Read in STATS19 road safety data from .csv files downloaded.
Usage
read_casualties(
year = NULL,
filename = "",
data_dir = get_data_directory(),
format = TRUE
)
Arguments
year |
Single year for which data are to be read |
filename |
Character string of the filename of the .csv to read, if this is given, type and years determine whether there is a target to read, otherwise disk scan would be needed. |
data_dir |
Where sets of downloaded data would be found. |
format |
Switch to return raw read from file, default is |
Details
The function returns a data frame, in which each record is a reported casualty in the STATS19 dataset.
Examples
if(curl::has_internet()) {
dl_stats19(year = 2022, type = "casualty")
casualties = read_casualties(year = 2022)
}
[Package stats19 version 3.0.3 Index]