fars_map_state: Map accidents on American state maps.

Description Usage Arguments Details References See Also

View source: R/fars_functions.R

Description

Display crashes for a state according to their MIPS code for a specified year.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

The FIPS state code that corresponds to a state. The FIPS state code of American territories such as Puerto Rico or American Samoa are not guaranteed to work, especially if the dataset doesn't contain information on those territories.

year

"character" or "integer" representing the year in XXXX format (e.g. 2013).

Details

Note that the year specified should be available on the current working directory, e.g. for year = "2013" the file "accidents_2013.csv.bz2" should appear when calling dir() in your instance. Do note that the following packages are needed: dplyr, tidyr, readr, magrittr, purrr, and maps.

References

Wikipedia Article on FIPS codes for a key between state.num and the region/state you want to input. https://en.wikipedia.org/wiki/Federal_Information_Processing_Standard_state_code#FIPS_state_codes.

See Also

Other FARS functions: fars_read_years(), fars_read()


SamHall14/wk4package documentation built on Dec. 18, 2021, 12:56 p.m.