knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
collisionsDE is a R library to simplify the use of the publicly available collision data from the German Federal Statistical Office
WARNING: This package is under development. Full functionality is not guaranteed!
You can install the released version of collisionsDE from GitHub
First, you need to install the devtools package. You can do this from CRAN. Invoke R and then type:
install.packages(devtools)
Load the devtools package.
library("devtools")
Now you can download the package with:
install_github("lutzhutz/collisionsDE")
Download all reported collisions of 2018 (if save = TRUE data frame will be saved as .csv file named "coll_2018")
library(collisionsDE) collisions_2018 <- import_2018(save = FALSE)
Add regional information to each of the collisions. This function will merge the collision dataset with the regiostar reference file by the Federal Ministry of Transport and Digital Infrastructure (BMVI). Among other it will add information about regional spatial types as well as the municipality, its area and population (german: Gemeinde) corresponding to each collision.
collisions_2018_regions <- add_regions(collisions_2018)
Add new column "coll_typ" giving information about which transport modes have collided (three = TRUE means all collisions with two or more transport modes involved are assigned a new group called "three").
collisions_2018_collision_types <- add_collision_types(collisions_2018, three = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.