Description Usage Arguments Details Value References Examples
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.
1 | fars_map_state(state.num, year)
|
state.num |
Is a numeric corresponding to the user provided state number. |
year |
Is a numeric corresponding to the user provided year. |
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.
a map of FARS events per state and year.
https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars
1 2 3 4 5 6 | fars_map_state(28,2015)
## Not run:
fars_map_state(3,2015)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.