knitr::opts_chunk$set(
  comment = "#>"
)
library(TestPackage)
library(maps)

The fars package reads and maps Fatal Analysis Reporting System or short FARS data for various years.

In the packages the data for the years 2013, 2014 and 2015 are included.

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

Package Functions

This pacakge provides various functions to work with the data files.

  1. make_filename This function returns file name and path to the data files:
yr <- 2015
make_filename(yr)
  1. fars_read_years This is just a helping function and should not be used on its own.

  2. fars_summarize_years This function summarizes accidents data of a given year by month.

yr <- 2015
fars_summarize_years(yr)
  1. fars_map_state This function generates a map plot showing accident locations by the given year and state number.
state_num <- 49 # Utah
yr <- 2014
fars_map_state(state_num, yr)


Anirie/TestPackage documentation built on Oct. 30, 2019, 4:54 a.m.