fars_map_state: Plots points where accidents for given state.num

Description Usage Arguments Details Value Note Examples

Description

fars_map_state plots the state given as an integer argument and plots accidents for a given year

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

state number to plot accidents for

year

year of data to plot accidents that occured

Details

The function will take a year and state and attempt to plot accidents for a given state number. If there is no data for a state, the function will stop and throw an error. If there are no accidents a message will be returning indicating this.

Value

a data.frame of filtered data, if there are no rows then returns invisible(NULL)

Note

This function depends on map and points functions from the maps and graphics package respectively.

Examples

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

## End(Not run)

ZeroStack/week2 documentation built on May 10, 2019, 1:57 a.m.