knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

This package is build with reference to final assignment for
COURSERA R SPECIALISATION: Building R Packages

[NOTE] This package is not meant for distribution

Summary

This vignette is concerned to explain the working of farviz package.
It is mainly used to locate the points of accidents occurance on the map.

Dataset

US NHTSA Fars Data (Fatality Analysis Reporting System)
This package has dataset in data/ subdirectory.

Loading Packages

library(farviz)
library(maps)

Included data

Data files included within the package are:

list.files(system.file("data", package = "farviz"))

Package Functions

Function make_filename

This function returns file name and path to the data files:

yr <- 2015
make_filename(yr)

Function fars_read_years

Helping function used by fars_summarize_years

plot(fars_summarize_years(2015))
fars_summarize_years(c(2015, 2014))

Function fars_summarize_years

This function summarizes yearly accidents data,filtered by month.

fars_summarize_years(2014)

Function fars_map_state

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

state_num <- 49 # Utah
yr <- 2014
fars_map_state(state_num, yr)


mayankvanani/Farvis-R-package documentation built on May 31, 2019, 4:55 a.m.