fars_map_state: Plot for a given state and year, overlay the location of...

Description Usage Arguments Details Value Note Examples

View source: R/Cousera4.R

Description

This function produces a drawing for a given state-year (state coded numerically) and overlays location of accidents on top of this drawing

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

State code, integer number

year

Integer number indicating a year of interest

Details

Uses function make_filename and fars_read from the current package. Removes coordinate outliers: longitude values greater than 900 are removed, and also latitude values greater than 90 are removed (i.e. not plotted).

Value

This function does not return anything, it just produces a plot

Note

Generates an error if the state number is not found in the dataset (invalid STATE number:...). If there are no accidents to plot, throws a message: no accidents to plot

Examples

1
## Not run: fars_map_state(3,2014)

ulicheva/Coursera4 documentation built on May 3, 2019, 2:24 p.m.