fars_read_years: Read the FARS data with given year

Description Usage Arguments Value Source See Also Examples

View source: R/fars_functions.R

Description

This function will search and read the FARS files in the current directory with the given years, then return dataframe with the given years and month of the fatal injuries incidents (long format, each year is a seperate dataframe), or NULL if the file not exist.

Usage

1

Arguments

years

a vector with list of years.

Value

If the given year exist, return a dataframe with the given year and month of the fatal injuries incidents (long format); if the file does not exist, return NULL with warning message "invalid year: ..."

Source

Data source: US National Highway Traffic Safety Administration's Fatality Analysis Reporting System (FARS), which is a nationwide census providing the American public yearly data regarding fatal injuries suffered in motor vehicle traffic crashes.

See Also

fars_read

make_filename

Examples

1
2
## Not run: fars_read_years(2013)
## Not run: fars_read_years(c(2013, 2014))

mandyhee/farspkg documentation built on June 12, 2020, 6:03 p.m.