Package Description

Fars package reads and plots in a map data from the Fatality Analysis Reporting System (FARS) of the National Highway Traffic Safety Administration

Load Packages

library(Fars)
library(maps)
library(dplyr)

Included data

Data files included within the package are:

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

Package Functions

Function make_filename

This function returns file name and path based on the input year

yr <- 2014
make_filename(yr)

Function 'fars_read'

This function reads a file provided by the make_filename funtion

filename <- make_filename(2013)
fars_read(filename)

Function fars_read_years

Function that will be used by the fars_summarize_years function

fars_read_years(2013)

Function fars_summarize_years

This function summarizes yearly accidents data, by year/month.

fars_summarize_years(2013:2015)

Function fars_map_state

The function displays a state map plot including accidents location by year

state_num <- 51 # Virginia
yr <- 2013
fars_map_state(state_num, yr)


joaojcorreia/FarsR documentation built on Feb. 18, 2020, 12:30 a.m.