This package is intended to allow light analysis of the Fatality Analysis Reporting System (FARS). This package will provide a mapping tool for plotting accident locations within an individual state. The FARS census information is provided by the National Highway Traffic Safety Administration (NHTSA).
library(fars) suppressWarnings(library(maps))
Three functions will be accessible to the end-user
fars_read()
(accessible to end-user)
make_filename()
'fars_read_years()'
fars_summarize_years()
(accessible to end-user)
'fars_map_state()` (accessible to end-user)
The fars_read() function allows the package to read example datafiles from a predetrmined path location. an output dataframe is generated for the user.
example_file <- system.file("extdata/accident_2014.csv.bz2", package = "fars") fars_read(example_file)
setwd(system.file("extdata", package = "fars")) fars_summarize_years(c(2013))
```r setwd(system.file("extdata", package = "fars")) state_num <- 18 fars_map_state(state_num, 2014)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.