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"))
This pacakge provides various functions to work with the data files.
make_filename
This function returns file name and path to the data files:yr <- 2015 make_filename(yr)
fars_read_years
This is just a helping function and should not be used on its own.
fars_summarize_years
This function summarizes accidents data of a given year by month.
yr <- 2015 fars_summarize_years(yr)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.