Package Description

The fars package reads data from Fatality Analysis Reporting System (FARS)
from the National Highway Traffic Safety Administration.

FARS is a nationwide census, providing the American public yearly data, regarding fatal injuries suffered in motor vehicle traffic crashes.

The package plots accidents on a map plot by year and state

Load Packages

library(fars)
library(maps)

Included data

Data files included within the package are:

list.files(system.file("extdata", package = "fars"))

Package Functions

Function fars_read

This function loads data from a comma separated file taken from the US National Highway Traffic Safetyc Administration's Fatality Analysis Reporting System (FARS).

#fars_read(filename)

Function make_filename

This function requires a year as input and returns a full FARS filename.

yr <- 2015
make_filename(yr)

Function fars_read_years

This function used by fars_summarize_years

fars_read_years(2013)

Function fars_summarize_years

This function summarises yearly accidents data, by month.

#plot(fars_summarize_years(2015))
#fars_summarize_years(c(2015, 2014))

Function fars_map_state

The function displays a state map plot including accidents location by year

#state_num <- 23
#yr <- 2014
#fars_map_state(state_num, yr)


Gregorypi/fars documentation built on May 23, 2019, 1:25 p.m.