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
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.
US NHTSA Fars Data (Fatality Analysis Reporting System)
This package has dataset in data/ subdirectory.
library(farviz) library(maps)
Data files included within the package are:
list.files(system.file("data", package = "farviz"))
make_filename
This function returns file name and path to the data files:
yr <- 2015 make_filename(yr)
fars_read_years
Helping function used by fars_summarize_years
plot(fars_summarize_years(2015)) fars_summarize_years(c(2015, 2014))
fars_summarize_years
This function summarizes yearly accidents data,filtered by month.
fars_summarize_years(2014)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.