Geographically plots highway fatalities from FARS data, subset by
Number encoding of state in FARS data. Argument can be input as integer or string. More information including codebook can be found at NHTSA website https://www.nhtsa.gov/research-data.
Four-digit year as integer or string of the data to be plotted.
state.num not found in data, function stopped and "invalid STATE
number" error will be returned. If no data file exists for
fars_read will return "file does not exist" error.
If there are no fatalities for described subset, returns message "no accidents to plot"
If the given value for state.num is not a state in the dataset, a "invalid STATE" error is raised.
1 2 3 4
## Not run: fars_map_state(1, 2013) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.