knitr::opts_chunk$set(echo = FALSE)
This code is part of an assignment from "Buiding R Packages" at Coursera. http://www.coursera.org.
Its main functions are fars_summarise_year
and fars_map_state
which allo users to produce descriptibe statistics of U.S. traffic accidents by year and month for the former, and to visualise traffic accidents in a given state and year on a simple contour map for the latter.
Data from 2013 to 2015 is available.
This is an example for 2013 to 2015: fars_summarize_years(c(2013:2015))
suppressMessages(library(fars)) suppressMessages(library(dplyr)) source(file="R/fars_functions.R") fars_summarize_years(c(2013:2015))
This is an example for Florida in 2013: fars_map_state("12","2013")
library(maps) fars_map_state("12","2013")
The function testing()
call a pre-defined series of tests.
test_output=fars_summarize_years(c(2013:2015)) testing()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.