In this vignette we provide a short of description on how \code{firstR} works.

The package allows to summarize and visualize data from the Fatality Analysis Reporting System.

Data loading

Some sample data is included in the package for convenience. It includes fars data from years 2013 to 2015.

Data is stored in *.csc.bz2 files in the r file.path('inst','extdata') directory, to get start copy any of the files to your working directory.

This files have a standard name, so you you can access data from the package functions using only the year number as input.

Summarizing data

A summary of the data in terms of number of fatalities by month can be computed with \code{\link{fars_summarize_years}}

The following code computes the summary for 2013 data.

library(firstR)

fars2013_14 <- fars_summarize_years(years = c(2013,2014))

fars2013_14

Data visualization

Finally the accident location can be plotted for a single state input. State code must be used as input.

fars_map_state(state.num = 1, year = 2013)


pabgamu/firstR documentation built on May 24, 2019, 5:57 p.m.