Twilight

Light, month and bike accidents

Berlin
Bike
2022
Open Data
Author

Néhémie Strupler

Published

February 23, 2022

I am continuing my lecture of the Berlin Police Report about bike accidents (see my posts 1 and 2). Today, I was curious to look at how the number of accidents change according to the month of the year. I was also interesting to explore the variable “Lichtverhältnisse” (light condition) that is categorised in “Tageslicht” (day light), “Dämmerung” (twilight) and “Dunkelheit” (night).

Picture of the day

This is a graph of the number of bike crashes split by month for Berlin and Brandenburg as well as “dodged” according to the light condition.

Show the code of the exhibit
# Select Berlin and Brandenburg
# ULAND = 11 (Berlin) | 12 (Brandenburg)
berbrand <- read.csv2(pipe("awk 'BEGIN {FS=\";\"} {if ($3 == 11 || $3 == 12 ) print $0}' Unfallorte2020_LinRef.csv"),
header=FALSE,
colClasses = c(rep("character", 2),
               rep("factor", 18),
               rep("character", 4),
               rep("factor", 1)
))
readLines("Unfallorte2020_LinRef.csv", n=1) |>
  strsplit(";") |> unlist()  |> tolower() -> colnames(berbrand)
levels(berbrand$ulichtverh) <-
  c("Tageslicht","Dämmerung","Dunkelheit")

library(ggplot2)
library(dplyr)

# Bike accident by month and light
jpeg("bike_unfaelle_month_light.jpg", width=800, quality=90)
ggplot(berbrand, aes(x = umonat)) +
  geom_bar(stat = "count",
           aes(fill = ulichtverh), position = "dodge" )+
                      theme_minimal() +
                      scale_fill_brewer(palette = "Accent") +
                      labs(x = "Monat")

dev.off()

Number of bike accident by month. Exhibit made with R (code provided in a comment of this webpage) Data Copyright: DL-DE BY 2.0 Statistische Ämter des Bundes und der Länder, Deutschland, 2021.

The graph illustrates the observation from the report stating that more accidents happen when the weather is better (and more people are ridding a bike). It is probably correlated with the number of sun hours per day. Concerning the light condition, it looks like that the pattern (more crashes by night in winter) is correlated with shorter daylight in December and January, when commuting is often done by nights. It does not seem to be an explanatory variable for crashes.