The package includes the FARS dataset files from years 2013 to 2015. To access the raw data files the user can use the following line of code:
system.file("extdata", "accident_2013.csv.bz2", package = "FARSpackageLCP") system.file("extdata", "accident_2014.csv.bz2", package = "FARSpackageLCP") system.file("extdata", "accident_2015.csv.bz2", package = "FARSpackageLCP")
This is the vignette for the R package FARSpackageLCP written in R Markdown as a html_vignette document. The R package FARSpackageLCP implements five useful functions to process and analyze data from the Fatality Analysis Reporting System (FARS). The functions are the following:
The R package FARSpackageLCP has the following main goals:
Manage FRS data file names from user provided year(s).
Extract and summarize FARS data from user provided year(s).
Map FARS data per state and user provided year.
From CRAN
install.packages('FARSpackageLCP')
From GITHUB
devtools::install_github("Darwinita/FARSpackageLCP")
LOAD using
library(FARSpackageLCP)
fars_read(filename)
filename, Is a character string with the name of the input data file.
make_filename(year)
year, A numeric corresponding to the user provided year.
fars_read_years(years)
years, Is a numeric vector containing the series of years for which to extract monthly FARS data.
fars_summarize_years(years)
years, Is a numeric vector containing the series of years for which to summarize FARS data.
fars_map_state(state.num, year)
state.num, Is a numeric corresponding to the user provided state number. year, A numeric corresponding to the user provided year.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.