fars_map_state: Map yearly traffic accidents occured in a state

Description Usage Arguments Value Examples

Description

This function maps locations of accidents occured in each state of a specific year. It provides messages if the state number is invalid or when there are no accidents to plot in a state of a given year. Before creating a map for a state all the missing observations involving Latitude and Longitude are removed from the dataset.This function uses (filter(data, state.num)) from dplyr package, and two other functions, one is (map(state, ylim, xlim)) from maps package, and the other (points(LONGITUD,LATITUD,pch)) from graphics package.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

A number representing a state that is converted as integer.

year

A four-digit number representing a specific year

Value

The function returns a state-specific map of a year, pointing fatal accident locations identified by dimensions of longitude and latitude.

Examples

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

## End(Not run)

mnazhasan/FarsRpkg documentation built on May 23, 2019, 5:06 a.m.