library(Farsdata) library(dplyr) library(maps)
This vignette is a brief overview of the Farsdata package and its functionality. It provides some useful functions for its analysis.
Three functions are exported so that the user can use them
fars_read()
fars_summarize_years()
fars_map_state()
Furthermore I desscribe how the functions works. I am using the FARS data files 2013-2014 which can be found in the directory Farsdata.
The function fars_read()
reads a data file from a path (as argument). It returns a loaded data set.
filename <- system.file("extdata/accident_2013.csv.bz2", package = "Farsdata") fars_read(filename)
The function fars_summarize_years()
takes a vector/ list of years as an argument and returns a tables of accidents per month and year.
setwd(system.file("extdata", package = "Farsdata")) fars_summarize_years(2013:2014)
The function fars_map_state()
takes a state and a year as inputs and returns a plot of the state and its accident locations.
setwd(system.file("extdata", package = "Farsdata")) fars_map_state(45, 2014)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.