knitr::opts_chunk$set(echo = TRUE)
library(fars) library(readr) library(dplyr)
The statistics about the accidents are collected and published by the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System (NHTSF), which is a nationwide census providing the American public yearly data regarding fatal injuries suffered in motor vehicle traffic crashes.
More information and the data files can be found on the website
@source https://www.nhtsa.gov/Data/Fatality-Analysis-Reporting-System-(FARS).
There are three data file (‘accident_2013’, ‘accident_2014’ and ‘accident_2015’) in the directory ~/inst/extdata.
They are used for tests, for examples and for show how to work with an dataset.
The fields of the csv files are shown here.
df <- fars_read( filename = "accident_2015.csv.bz2" ) str(df)
Let's have a look at an output of the first 10 table entries for some fields.
knitr::kable( head(df, 10) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.