
English | Deutsch
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).
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:
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).
# install.packages("remotes")
remotes::install_github("ofurkancoban/pksR")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 checksoffence 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 labelsSome 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 |
All columns are described in vignette("pksR").
hz * population / 1e5) and marked
estimated = TRUE.estimated = TRUE; merges are exact.
pks_compare_weights() shows how much a panel changes
between population and area weights.pks_breaks() before reading a time
series.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.
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 |
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.
2026.1,
2026.2, …) and never changes; corrections become a new
version. pks_versions() lists them,
pks_manifest() shows the files of one release.pks_get() downloads only the years you ask for and
checks every file against the SHA-256 checksum in the release
manifest.tools::R_user_dir("pksR", "cache");
pks_cache_info() and pks_cache_clear() manage
the cache.data_version, retrieved_at,
boundary_year, weights and
source_urls.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.
The package code is MIT licensed. The data keep the terms of their sources:
data-raw/logo.R.inkaR:
regional indicators of the BBSR (INKAR), for example population and
economic covariates for the same districts.ags: BBSR
crosswalks for German district codes.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.
Ömer Furkan Çoban