Description Usage Arguments Details Value Note Examples
This function plot a map where all accidents for the specified states (state.num
) and the specified year
are mapped, dependent on a csv file where these data are stored.
1 | fars_map_state(state.num, year)
|
state.num |
a numeric vector, specifying the state which should be plotted. |
year |
a numeric vector of length one, specifying for which year the accidents should be plotted. |
This function incluede the read_csv
, tbl_df
, filter
and map
functions.
Therefore the dplyr, maps and readr package has to be installed and loaded.
This function has no return value. It generates a plot with all accidents of the corresponding year and state.
If for the year no file exists an error occurs. If the state specifyed with state.num
does not exist in the data an error occors.
If no coordinates exists for any of the accidents an error occurs.
1 2 3 | ## Not run: fars_map_state(01 , 2013)
## Not run: fars_map_state(01 , 2014)
## Not run: fars_map_state(02 , 2014)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.