fars_map_state: Map FARS data by State

View source: R/fars_functions.R

fars_map_stateR Documentation

Map FARS data by State

Description

This function creates a map of accidents for a state, specified by its state number. If there are no accidents to plot for that state, a message saying so will be printed. If a state does not exist which corresponds to the number inputted, an error will be thrown. An error will also be thrown if the state is out of bounds for plotting. This happens for the states of Alaska and Hawaii which are not part of the contiguous United States.

Usage

fars_map_state(state.num, year)

Arguments

state.num

A numeric object or character string representing the number of the state for which accidents should be mapped.

year

A numeric object or character string representing the year for which the state's accidents should be mapped.

Value

Null. Displays a state map with accident locations plotted on it by their longitude and latitude in the file browser tab. Nothing is displayed if no accidents to show.

Examples

## Not run: fars_map_state(48,2015)
## Not run: fars_map_state("13","2014")


haliyan/fars.functions documentation built on May 9, 2022, 8:30 p.m.