fars_map_state: fars_map_state

Description Usage Arguments Value Examples

Description

This function takes in a state number ("state.num") and year ("year") as arguments. It reads the corresponding accident data file per the "year" argument, extract data corresponding to the specified state, then uses the map function from maps package to provide a map plot showing the locations corresponding to the accident data for the specified state in the specified year. The function will stop if the state number entered is invalid, and will also not provide any plot if there are no accidents for the specified state in the given year.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

Integer (1 to 56) corresponding to the state of interest.

year

Integer (e.g. 2013) denoting the year for which the map plot is desired.

Value

This function returns a map plot showing the location of accidents for the specified state in the specified year.

Examples

1
fars_map_state (20, 2013)

izlude83/week4 documentation built on May 14, 2019, 6:03 a.m.