fars_read_years: Read and wrangle multiple Fatality Analysis Reporting System...

Description Usage Arguments Details Value References See Also Examples

View source: R/fars_functions.R

Description

fars_read_years reads Fatality Analysis Reporting System (FARS) files for multiple years and rearranges the data such that each row contains one incident with columns MONTH and year.

Usage

1

Arguments

years

(character or (integer) ) A vector containing the desired years. Both numeric and character vectors are allowed for years. years is coerced to integer. If years cannot be coerced to integer, fars_read_years will result in an error as filenames cannot be created properly.

Details

list is also allowed for year but not recommended. Files must exist in current working directory. If files are not found in current working directory, execution is stopped and a warning is thrown.
fars_read_years is a helper function for fars_summarize_years.

Value

A list containing the rearranged datasets for each given year.

References

US National Highway Traffic Safety Administration
(https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars)

See Also

fars_read, make_filename, fars_summarize_years

Examples

1
2
3
4
5
6
7
## Not run: 
lst <- fars_read_years(c(2014, 2015))
lst <- fars_read_years(c("2014", "2015"))
# also usage of lists is allowed:
lst <- fars_read_years(list(2014, "2015"))

## End(Not run)

philippB-on-git/fars documentation built on Dec. 22, 2021, 7:49 a.m.