Description Usage Arguments Value Examples
The function accepts a state number and year and plots the accidents in a simple map. The state number should be integer or numerical and should exist in the FARS data, otherwise the function terminates with an error. Also returns an error if the data file for the year input does not exist.
The function accepts a state number and year and plots the accidents in a simple map. The state number should be integer or numerical and should exist in the FARS data, otherwise the function terminates with an error. Also returns an error if the data file for the year input does not exist.
1 2 3 | fars_map_state(state.num, year)
fars_map_state(state.num, year)
|
state.num |
The number of a state in the US as used in the FARS data sets. Should be numeric or integer. |
year |
The year of analysis (numeric or integer) |
state.num |
The number of a state in the US as used in the FARS data sets. Should be numeric or integer. |
year |
The year of analysis (numeric or integer) |
Returns a plot of the accidents based on the state.num
and
year
inputs. Returns an error if the state or year do not exist in the
data set.
Returns a plot of the accidents based on the state.num
and
year
inputs. Returns an error if the state or year do not exist in the
data set.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
fars_map_state(45, 2015)
# Results in an error
fars_map_state(45, 2016)
fars_map_state(60, 2015)
## End(Not run)
## Not run:
fars_map_state(45, 2015)
# Results in an error
fars_map_state(45, 2016)
fars_map_state(60, 2015)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.