Package Description

fars package reads and map Fatality Analysis Reporting System (FARS) data for states in US from the National Highway Traffic Safety Administration.

FARS is using data 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.

Load Packages

library(fars)
library(maps)
library(dplyr)

datafiles

Datafiles in the package are:

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

Package Functions

Function fars_read

read in a data file as a tibble named "data":

dat<-fars_read("accident_2013.csv.bz2")

Function make_filename

Make the filename like "accident_2013.csv.bz2", depend on the year.

make_filename(2013)

Function fars_read_years

fars_read_years(2013)

Function fars_summarize_years

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 showing the distribution. The state.num is between 1 to 56.

fars_map_state(34,2013)

Links:



Beryli-122/fars documentation built on June 23, 2020, 12:05 a.m.