The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

pksR: District-Level German Police Crime Statistics pksR logo

English | Deutsch

R-CMD-check test-coverage Lifecycle: experimental Project Status: Active DOI (data releases)

pksR gives R users the district (Kreis) tables of the German Police Crime Statistics (Polizeiliche Kriminalstatistik, PKS) of the Bundeskriminalamt (BKA) from 2003 onwards, either as published or harmonized to one territorial boundary and one offence classification, so that districts can be compared over time.

Not to be confused with the CRAN package pks (probabilistic knowledge structures).

Why pksR

The BKA publishes the district tables once a year: as PDF yearbooks up to 2012 and as spreadsheets from 2013, each with its own layout and its own district boundaries. Districts were merged and split several times (Sachsen-Anhalt 2007, Sachsen 2008, Mecklenburg-Vorpommern 2011, Göttingen 2016, Eisenach 2021), and offence keys change. pksR does this work once, openly and reproducibly:

Status

The package is under development and not yet on CRAN. The first data release, v2026.1 (reporting years 2003 to 2025, boundary of 2025), was published on 1 November 2026 (doi:10.5281/zenodo.23858429).

Installation

# install.packages("remotes")
remotes::install_github("ofurkancoban/pksR")

Getting started

library(pksR)

# Total offences in every district and year, harmonized to the latest boundary
total <- pks_get(offence = "total")

# Several offences at once: by short name, offence key or label
d <- pks_get(years = 2015:2025, offence = c("residential_burglary", "730000", "Gewaltkriminalität"))

# As published by the BKA: each year with its own districts
published <- pks_get(years = 2024:2025, harmonize_to = NULL)

# Harmonized to the boundary of 2016, area weights for split districts
d2016 <- pks_get(years = 2010:2015, harmonize_to = 2016, weights = "area")

# A fixed data release, for reproducible work
d <- pks_get(version = "2026.1", offence = "total")

Without internet, try the small example panel shipped with the package:

d <- pks_example()
pks_rates(d, per = 1000)   # rates per 1,000 inhabitants
pks_validate(d)            # consistency checks

Choosing offences

offence takes, for each element, one of:

Form Example Result
Offence key "435*00" that key
Short name, English or German "residential_burglary", "wohnungseinbruch" that key
Full label, either language "Residential burglary" that key
Part of a label "einbruch" every matching key, with a message saying which

Capitals, spaces and umlauts do not matter, and an exact key, name or label always wins over a part. pks_offences() lists all keys:

pks_offences("theft")              # search by name or label
pks_offences(lang = "de")          # German names and labels

Some common short names:

Key English German
------ total insgesamt
****00 theft diebstahl
435*00 residential_burglary wohnungseinbruch
210000 robbery raub
892000 violent_crime gewaltkriminalitaet
674000 criminal_damage sachbeschaedigung
730000 drug_offences rauschgiftdelikte
899000 street_crime strassenkriminalitaet

What the data contain

All columns are described in vignette("pksR").

Things to keep in mind

Languages

options(pksR.lang = "de") switches messages and offence labels to German, options(pksR.lang = "en") to English; otherwise the language of the R session is used. pks_get() and pks_offences() also take lang = "de" or lang = "en". Every help page has a German section.

Documentation

The package website has the reference and three articles, each in English and German:

Article English German
Getting started pksR pksR-de
Harmonization: methods, assumptions and sensitivity harmonization harmonization-de
Data provenance and validation provenance provenance-de

Data releases and cache

The data are produced by pksR-data, a pipeline that downloads the original BKA files, extracts, harmonizes and validates them, and publishes each result as a GitHub release.

Citation

Please cite the package, the data release and the sources. pks_cite() returns all entries, including BibTeX:

pks_cite()
pks_cite(version = "2026.1")

Every data release is archived on Zenodo. The concept DOI 10.5281/zenodo.23858428 always resolves to the latest version; cite the DOI of the version you used, for 2026.1 10.5281/zenodo.23858429.

Sources and terms of reuse

The package code is MIT licensed. The data keep the terms of their sources:

Contributing

Bug reports and suggestions are welcome in the issue tracker. Problems with the data themselves (a wrong value, a missing district) are best reported in the pksR-data issues. See the contributing guide for pull requests and the roadmap for planned work.

Author

Ömer Furkan Çoban

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.