This is an overview of an R package that contains functions to read in, summarize, and map car crash fatality data available from the National Highway Traffic Safety Admnistration's FARS dataset.

library(FARS)
library(dplyr)
library(maps)

FARS Package Content

The FARS package is composed of the following elements or data handling routines:

fars_read: This function reads data on car accidents into R and displays it as a table make _file_name: This function sets the file name for the data that was imported in the Fars Read function fars_read_years: This function applies the Make File Name function above to a set of specified years fars_summarize_years:This function summarizes the data by counting up the number of observations by year and month. fars_map_state: This function creates a map showing the location of car accidents in a given state in a given year

Required Packages

The following packages are loaded and required by the package.

library(FARS)
library(maps)

Data Files

Data files can be found at

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

fars_read

df<-fars_read("accident_2014.csv.bz2")

make_file_name

df<-make_filename(2013)

far_read_years

df<-fars_read_years(2013:2015)

fars_summarize_years

fars_summarize_years(2013:2015)

fars_map_state

fars_map_state(23,2015)


AESpe/FARS documentation built on April 29, 2020, 12:24 a.m.