fars_map_state: Maps accidents onto states

Description Usage Arguments Value Examples

Description

Takes input of a state.num and year as arguments and plots the accidents onto a map of the states. If the state number is invalid, an error is thrown. If there are no accidents in that state, a message is returned that there are no accidents to plot.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

A numerical integer denoting the US state as is shown in the data set

year

A numerical integer denoting the year

Value

Returns a plot of states with the number of accidents on each states the accidents based on the year. Returns an error if state.num or if year do not exist in the data set.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
fars_map_state(20, 2013)
fars_map_state(10, 2014)
fars_map_state(30, 2016)

fars_map_state(72, 2013) #Error because \code{state.num} doesn't exist
fars_map_state(20, 2020) #Error because \code{year} doesn't exist

## End(Not run)

swethagarimalla/FARS documentation built on May 24, 2019, 7:16 a.m.