fars_map_state: Plots the accidents on a US state map

Description Usage Arguments Value Examples

View source: R/fars_functions.R

Description

This function plots the accidents in a simple map. The state number should be integer or numerical and should exist in the FARS data, otherwise the function terminates with an error. Also returns an error if the data file for the year input does not exist.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

The number of a state in the US as used in the FARS data sets. Must be integer

year

The year of analysis. Must be integer.

Value

a plot of the accidents based on the state.num and year inputs.

Examples

1
2
3
4
5
6
7
8
## Not run: 
fars_map_state(45, 2015)

# Results in an error
fars_map_state(45, 2016)
fars_map_state(60, 2015)

## End(Not run)

ThoDuyNguyen/fars documentation built on May 20, 2019, 3:34 p.m.