knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(fars)
The FARS data files are expected to be in the working directory and their names should be accident_YYYY.csv.bz2. Missing files cause an error. The specific FARS data format is as provided by Coursera course Building R Packages by Johns Hopkins Univ.
You can draw a wireframe map of a given state and year from US National Highway Traffic Safety Administration's Fatality Analysis Reporting Syste (FARS) data for given years.
fars_map_state(1, 2013)
You can Cross-tabulate number of fatal highway accidents by month and year (FARS data) by fars_summarize_years
.
fars_read_years
is for loading the data into a data frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.