fars_map_state: fars_map_state The fars_map_state plots the accident...

Description Usage Arguments Value Note Examples

View source: R/fars_functions.R

Description

fars_map_state The fars_map_state plots the accident locations of the years 2013, 2014,and 2015 per state. The state is called by its number

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

state number as an integer, number must be between 1 and 51

year

year as a string or an integer

Value

returns a plot of accident locations in the state called for the year called.

This function returns a NULL object. But as a side effect a map where dots represent accidents also appears in a seperate window.

Note

Receives data from make_filename and fars_read functions. There are only 51 states in the USA. If a wrong state number is entered an error message will state "invalid STATE number: " with the wrong number printed. If there is no data for a specific year, there is an error message saying "invalid year: " with the year printed. If no accident occurred in the called state and year, the error message "no accidents to plot" appears. Accidents for which the database has no data with regurds to LONGITUD and LATITUDE are placed outside of all potentital plots

Examples

1
fars_map_state(51, 2013) plots the accident locations for state 51 in year 2013.

Sensalis/farsHK documentation built on Oct. 30, 2019, 11:51 p.m.