fars_map_state: Creates a map plot that shows the location where traffic...

Description Usage Arguments Details Value Note See Also Examples

View source: R/fars_map_state.R

Description

fars_map_state takes a numerical vector corresponding to the state whose data will be plotted and the year when the data occurred. For this function to work, data should be in .csv.bz2 format located in the same directory as the working directory. In case the data for a particular year is unavailable, the function will show an error message for the year that was not available.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

A numerical vector corresponding to a particular state in the USA.

year

A numerical vector corresponding to a particular year.

Details

If you have a file from FARS that is in .csv format but not in .csv.bz2 format, you can convert it to .csv.bz2 format by using the write.csv function in R. See vignette "Other functions in readFARS".

Value

A plot of the map of the state of interest with points on the map indicating traffics fatalities occurred.

Note

In case the chosen numerical vector does not correspond to a particular state, the function will stop and show an error message. The numbers 3, 7, 14, and any number above 56 will result in an error. In case, there are no traffic accidents for that particular year or state, a message will appear stating there are no accidents to plot.

See Also

make_filename

fars_read

Examples

1
2
fars_map_state(2, 2013)
fars_map_state(2000, 2013)

DocOfi/FARSread-Package documentation built on May 21, 2019, 3:07 a.m.