The goal of fars is to describe data from the US National Highway
Traffic Safety Administration’s Fatality Analysis Reporting System, in
the time period 2013-2015. It has two functions fars_summarize_years
and fars_map_state
You can install the development version of fars like so:
install_github('mentoldo/fars', build_vignettes=TRUE)
It has two functions fars_summarize_years
and fars_map_state
.
fars_summarize_years
makes a frecuency table for accidents by months
for years passed as arguments for all US States.
library(fars)
## basic example code
library(kableExtra)
fars_summarize_years(c(2013, 2014, 2015)) %>%
kable()
#> [1] 2013
#> [1] "/home/psyche/R/x86_64-pc-linux-gnu-library/4.1/fars/extdata/accident_2013.csv.bz2"
#> [1] 2014
#> [1] "/home/psyche/R/x86_64-pc-linux-gnu-library/4.1/fars/extdata/accident_2014.csv.bz2"
#> [1] 2015
#> [1] "/home/psyche/R/x86_64-pc-linux-gnu-library/4.1/fars/extdata/accident_2015.csv.bz2"
MONTH | 2013 | 2014 | 2015 |
---|---|---|---|
1 | 2230 | 2168 | 2368 |
2 | 1952 | 1893 | 1968 |
3 | 2356 | 2245 | 2385 |
4 | 2300 | 2308 | 2430 |
5 | 2532 | 2596 | 2847 |
6 | 2692 | 2583 | 2765 |
7 | 2660 | 2696 | 2998 |
8 | 2899 | 2800 | 3016 |
9 | 2741 | 2618 | 2865 |
10 | 2768 | 2831 | 3019 |
11 | 2615 | 2714 | 2724 |
12 | 2457 | 2604 | 2781 |
fars_map_state
plots the geolalization of all fatal crashes in
highways in the indicated year and state.
fars_map_state(26, 2015)