fars_map_state: Map of Accidents within a State and Year

Description Usage Arguments Details Value Examples

Description

This function creates a map of accident locations within the specified state (state.num) and year.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

An integer corresponding to a specific state. Indicates which state to map

year

An integer or character string giving the year for the filename

Details

This function requires both the maps and graphics packages.

If state.num is not within STATE column (1-50 corresponding to 50 states in alphabetical order), will return error: "invalid STATE number:".

If there are no accidents within the specific state.num and year, function will return message: "no accidents to plot".

If year is not contained within the datasets (2013, 2014, or 2015), the function will return a warning: "invalid year:".

Value

This function returns a graphic plot of the accident locations within a specified state (state.num) and year. Points indicate accident locations and solid lines indicate state boundary.

Examples

1
2
## Not run: fars_map_state(1,2013)
## Not run: fars_map_state(20,2014)

mahonmb/FARSfun documentation built on May 29, 2019, 11:40 a.m.