Mastering Software Development with R, third course provides the functions using data from the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System (FARS), which is a nationwide census providing the American public yearly data regarding fatal injuries suffered in motor vehicle traffic crashes to illustrate R package building process.
To this end, there are five functions that work to summarize and map FARS data. Three functions--make_filename, fars_read, and fars_read_years--are involved in reading FARS data for summarization and mapping. The workflow is as follows:
The above workflow completes initial loading of data to be used for summary and mapping.
# Examples make_filename(2013) fars_read(make_filename(2013))
The main functions are fars_summarize_years and fars_map_state. fars_summarize_years take in a year or vectors of years and produces a tibble that counts the number of incidents by month for the years specified. With this information fars_map_state graphically illustrates those incidents by utilizing additional data from the file (longitudes, lattitudes and state Id).
# Examples fars_summarize_years(2013) fars_map_state(2013)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.