The package reads in data from the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System (FARS). It provides summaries of the data by months and maps the distribution of accidents per state.
Data files included within the package are:
list.files(system.file("extdata", package = "Fars"))
fars_read
This function reads in csv data.
make_filename
This is a function that returns a filename in the format "accident_year.csv.bz2", where you can specify the year.
make_filename(2013)
fars_read_years
This is a function that reads in FARS data by using as an input the year.
fars_read_years(2013)
fars_summarize_years
This function summarizes "FARS" data per month in a given year, that is specifid in the input.
fars_summarize_years(2013)
fars_map_state
This function plots the geographical boundaries of a state and the distribution of reported accidents within the state.
state_num <- 18 yr <- 2013 fars_map_state(state_num, yr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.