knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
#library(trypackage)
This package will be using 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.
This package has five functions:
fars_read: This is a function that reads data from US National Highway Traffic Safety Administration's found in the working directory.
make_filename: This function creates the name of the US National Highway Traffic Safety Administration's data set for the selected year.
fars_read_years: This function reads data from the US National Highway Traffic Safety Administration and returns the variables month and year.
fars_summarize_years: This function summarizes fatal injuries sustained in motor vehicle traffic accidents by month.
fars_map_state: This function graphs the latitude and longitud of the selected state.
# year <- make_filename(year = 2013) # # data <- fars_read(filename = year) # # data2 <- fars_read_years(2013) # # data3 <- fars_summarize_years(years = 2013) # # fars_map_state(state.num = 1, year = 2013)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.