fars_map_state: fars_map_state

Description Usage Arguments Details Value References Examples

View source: R/fars_functions_LCP.R

Description

A function to create a map of FARS events and points a plot for a given a state number and year.

fars_map_state This function uses an user provided state number and year to create a map of FARS events and their corresponding points plot.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

Is a numeric corresponding to the user provided state number.

year

Is a numeric corresponding to the user provided year.

Details

The make_filename function from this package generates a filename for the input year. The data from the generated file is then extracted using the fars_read function from this package. The state number is explicitly converted into an integer. The function checks if the year is not included in the dataset and stops in that case. If no accidents are reported for that state, a warning message is returned. LONGITUD and LATITUDE values are converted to NA if higher than 900 or 90, respectively.

Value

a map of FARS events per state and year.

References

https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars

Examples

1
2
3
4
5
6
7
8
## Not run: 
fars_map_state(28,2015)

## End(Not run)
## Not run: 
fars_map_state(3,2015)

## End(Not run)

Darwinita/FARSpackageLCP documentation built on May 27, 2019, 4:06 a.m.