fars_map_state: Print "FARS Map State"

Description Usage Arguments Value Note Examples

View source: R/fars_functions.R

Description

fars_map_state maps out the fatal motor vehicle accidents for a particular state in a particular year, according to data compiled by the Fatality Analysis Reporting System (FARS) of the US National Highway Traffic Safety Administration.

Usage

1
fars_map_state(state.num, year, dir = "./inst/extdata")

Arguments

state.num

number of state for which data is requested (between 1 and 51).

year

desired calendar year

dir

a character string containing the directory that contains the FARS data

Value

The function plots a map of the state in question, with points marking the locations of fatal motor vehicle accidents in the specified year.

Note

An error message will be generated if the state number is not in the required range (1 to 51), if the data file for the specified year cannot be found, or if the data file is not in the proper FARS format.

Examples

1
2
3
dir <- system.file("extdata",package="msdr3pam")
fars_map_state(26,2013,dir=dir)
fars_map_state(1,2015,dir=dir)

mmiesch/msdr3pam documentation built on May 18, 2019, 9:14 p.m.