Description Usage Arguments Details Value Examples
This function takes a State Number (state.num
) and a Year (year
) to import a file (based on the year parsed) as a R tibble dataframe.
After filtering the dataframe based on State Number (state.num
), the function outputs a geo-plot of the filtered State Number (state.num
) with the volume of accidents.
1 | fars_map_state(state.num, year)
|
state.num |
A character variable representing the State Number reference to use to plot the volume of accidents. |
year |
A character variable representing the year of the file to import. |
The function uses fars_read function (fars_read
) and make_filename (make_filename
) to execute the described process.
If State Number (state.num
) doesn't exist on the dataframe an error is returned (i.e. invalid STATE number: 324).
If the filtered dataframe has zero records - the function returns a message 'no accidents to plot'.
Longitudes higher than 900 and Latitudes > than 90 are treated as NAs for plotting purposes.
A geo-plot of the State Number (state.num
) with the volume of accidents.
1 2 3 4 | ## Not run:
fars_map_state(state.num = "6", year = "2015")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.