fars_map_state: Plot FARS data to a state map

Description Usage Arguments Details Value Examples

Description

This function plots individual FARS accidents' coordinates as points on a stat map

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

An intger represents the identifier of a state.

year

An integer, or any other type could be coerced to an integer, represents the year of the FARS data file.

Details

The function returns an error invalid STATE number: state.num if the provided number does not correspond to a STATE in the data of this particular year and a message no accidents to plot if the number of accident for this year is 0. otherwise it constructs a file name using the provided year, read the data file and plot points of individual accidents on the STATE map.

Value

A plot of a state from map and points correspond to the coordinates of recorded accidents.

Examples

1
2
3
4
## Not run: 
fars_map_state(50, 2013)

## End(Not run)

MahShaaban/fars documentation built on May 8, 2019, 3:21 p.m.