library(dplyr)
library(readr)
library(tidyr)
library(maps)
library(Second)

This vignette gives instructions about how to use the Second package to analyze data from Fatality Analysis Reporting System (FARS) (www-fars.nhtsa.dot.gov).

Read a datafile from the working path.

fars_read(system.file("extdata","accident_2013.csv.bz2",package="Second"))

Create an appropriate file name.

make_filename(2013)

Create multiple years of data.

A list of tbls representing the year, Month data extracted from the given set of years from the Fatality Analysis Reporting System.

setwd(system.file("extdata", package = "Second"))
fars_read_years(2013:2015)

Summarize by years.

Creates a country-wide summary table of the number of fatal accidents by month by year for a given set of years.

setwd(system.file("extdata", package = "Second"))
fars_summarize_years(2013:2015)

Sumarize by monthy by years for a given state.

Creates a summary table of the number of fatal accidents by month by year for a given set of years for a given state.

setwd(system.file("extdata", package = "Second"))
fars_map_state(1,2013)


John-GitHub/Second documentation built on May 7, 2019, 11:16 a.m.