The goal of TestNewPackage is to test R with Github for the an assignment in the ‘building R packages’ Coursera course.
You can install the released version of TestNewPackage from CRAN with:
install.packages("TestNewPackage")
And the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("EV201/TestNewPackage")
The fars functions use the buildin databases: accident_2013.csv.bz2, accident_2014.csv.bz2, accident_2015.csv.bz2 You can access these databases directly by system.file(“extdata”, filename, package = “TestNewPackage”)
The fars functions show a summary of the accidents per month and year (fars_summarize_years()) or the accidents for a year on a map for a state (fars_map_state()). Only the years 2013-2015 can be used.
library(TestNewPackage)
summarizing accidents for a year:
fars_summarize_years(2013)
#> # A tibble: 12 x 2
#> MONTH `2013`
#> <dbl> <int>
#> 1 1 2230
#> 2 2 1952
#> 3 3 2356
#> 4 4 2300
#> 5 5 2532
#> 6 6 2692
#> 7 7 2660
#> 8 8 2899
#> 9 9 2741
#> 10 10 2768
#> 11 11 2615
#> 12 12 2457
or plotting the accidents for a year on a state map:
fars_map_state(1, 2015)
#> [1] 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.