This package allows you to easily analyze data from the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System, which is a nationwide census providing the American public yearly data regarding fatal injuries suffered in motor vehicle traffic crashes.
The specific functions in this package (see below) are designed to be used in reading and analyzing data from the Fatality Analysis Reporting System, which is a nationwide census providing the American public yearly data regarding fatal injuries suffered in motor vehicle traffic crashes. More details
Make sure that you have downloaded FARS data before running the functions below. The data files should be at the root of your working directory.
# library(dplyr) # library(readr) # library(maps) # library(week4pkg)
Create filenames that look like accident_
make_filename(2015)
Creates a dataframe from the filename specified.
fars_read("accident_2015.csv.bz2")
Creates a dataframe for the years specified.
fars_read_years(2013:2015)
Summarizes the data for the years specified.
fars_summarize_years(2013:2015)
Map locations of accidents
fars_map_state('05', 2015)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.