library(finalassignment)
This package provides a simple set of 5 functions, allowing to load, summarize and plot FARS data, with some filtering functions.
Produce standardized filnames for one or several years of data:
my_years<-c(2013, 2014, 2015) my_filenames <- make_filename(my_years) print(my_filenames)
Read one standardized FARS file and store it into a tib data.frame:
my_data_2013 <- fars_read(my_filenames[1]) str(my_data_2013)
Read several standardized FARS files in function of years specified in input, and store each file in one element of a list (only MONTH and year columns are preserved):
my_data_all <- fars_read_years(my_years) str(my_data_all)
Count the number of accidents for each month of every specified years:
my_summary <- fars_summarize_years(my_years) my_summary
Plot all accidents recorded a specified year in a state as black dots on a map:
fars_map_state(13, 2013)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.