Package Description

Data Description

The data in this package come from the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System, which is a nationwide census providing the American public yearly data regarding fatal injuries suffered in motor vehicle traffic crashes. You can download the data for this assignment here:

Load Packages

library(farsdata)
library(maps)

Included data

Data files included within the package are:

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

Package Functions

Function make_filename

This function returns file name and path to the data files:

yr <- 2013
make_filename(yr)

Function fars_read_years

Ancillary function used by fars_summarize_years

fars_read_years(2013)

Function fars_summarize_years

This function summarizes 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 <- 49 # Utah
yr <- 2014
fars_map_state(state_num, yr)


Daviddlhy/farsdata documentation built on Dec. 31, 2020, 11:55 a.m.