fars_map_state: Plot the location of fars accident reports

Description Usage Arguments Details Value Examples

Description

This function plots the accident reports of a given year and in a given state on a map of the state.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

the numeric code for the state or territory to be plotted.

year

A 4-digit year number (YYYY) specifying the FARS file to be read.

Details

The function will fail if the state code is not in FARS file. If there are no accidents to plot, a message is produced to that effect.

The following functions are imported: maps::map, graphics::points, dply::filter.

Value

The function returns a NULL value.

Examples

1
2
3
fars_map_state(1, 2014)
# following will fail
#not run, will fail: fars_map_state(1, 2019)

dmendres/farsAssignment documentation built on May 15, 2019, 9:20 a.m.