fars_map_state: Generate a map of all incidents in a given year

Description Usage Arguments Value Examples

View source: R/fars_functions.R

Description

This function uses the maps package to display dots for each incident on a map of a given state over a given year. It takes as inputs the state, represented by its number with all states ordered alphabetically, and year. The filter function from the dplyr package is used to consolidate the data

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

an integer from 0 through 51, representing each state and the District of Columbia

year

An integer representing a year that is 2013, 2014, or 2015

Value

A map of the state with each dot representing an incident. If there are no accidents in that state in the given year, the function returns a message as such. If a number is input that does not correspond to a state, the function returns a message that the provided state number is invalid

Examples

1
2
3
4
5
## Not run: 
fars_map_state(5, 2013)
fars_map_state(51, 2014)

## End(Not run)

MikePJones/Week4Proj documentation built on May 17, 2019, 2:46 p.m.