Corrected the catalog year range for ltw_wkr_unharm
and ltw_wkr_unharm_long to 1980-2026. The upstream data
added 28 historical state elections at the Wahlkreis level in August
2026 (Saarland from 1980; most states from the 1990s or 2000s); the data
itself is unchanged by this package update.
Corrected the year ranges that gerda_data_list()
reports, which were shorter than the data. Every corrected range was
read from the file on 2026-11-06. The downloads themselves are
unchanged.
federal_cty_unharm 1953-2025 and
federal_cty_harm 1990-2025 (previously listed as ending in
2021).state_unharm 1946-2026 (previously 2006-2019);
state_harm_21, state_harm_23 and
state_harm_25 1990-2026. The legacy state_harm
file now covers 1946-2025 and is marked as kept for backward
compatibility; use state_harm_21 or
state_harm_25 instead.municipal_unharm and
municipal_harm_25 1969-2026.county_elec_unharm 1948-2026,
county_elec_harm_21_cty 1990-2026,
county_elec_harm_21_muni 1991-2026; all mayoral files and
landrat_candidates 1945-2026.ags_area_pop_emp and
cty_area_pop_emp run through 2024).The boundary column now names the 2021 target for
files previously labelled harmonized or
current: municipal_harm,
federal_cty_harm, european_muni_harm,
mayoral_harm, mayor_panel_harm,
mayor_panel_annual_harm and
county_council_seats. The value current is no
longer used. Code that filters gerda_data_list() on
boundary == "harmonized" or "current" needs
updating.
party_crosswalk() now recognises bsw
and werteunion, which appear in recent federal, state,
municipal, European and Kreistag files. ParlGov does not cover either
party, so only the name destinations are filled (BSW under its official
name since 1 October 2026, “Bündnis Soziale Gerechtigkeit und
Wirtschaftliche Vernunft”); party family, ideology scales and
identifiers stay NA.
Refreshed the ParlGov values in the party lookup table
(2026-11-06). The only change is AfD left_right, now 8.8
(was 8.7). ## Updated Data
The bundled INKAR county covariates
(gerda_covariates(), add_gerda_covariates())
now come from the INKAR 2025 edition (BBSR, August 2025) and run from
1995 to 2023 (previously 2022; 11,600 rows). The same 30 variables,
names and units are kept. Most variables gain one year. A few gain more:
municipal debt and tax revenue now reach 2023 (were 2019), childcare
2023 (was 2020), unemployment, purchasing power and low-income
households 2023 (were 2021). Physician and GP density still end in 2022.
Elections in 2023 now receive covariates, and 2022 elections gain the
variables that previously ended in 2021; the 2025 federal election still
falls outside the coverage window.
BBSR revised some earlier values in this edition: every
population-based variable for 2022 (median change below 2% for most,
about 6% for share_foreign), GDP and sector shares for
2000-2021, and asking rents (rent_level) for all years
(yearly means change by less than 1%). Results that use these covariates
can change slightly. missing_pct in
gerda_covariates_codebook() is recomputed over the longer
panel.
year_start/year_end. An opt-in online test
(GERDA_TEST_YEARS=true) compares the catalog with every
published file.load_gerda_web() are now wrapped in
\dontrun{} rather than \donttest{}. Under
\donttest{} these examples ran on the CRAN check machines,
where one of them passed cache = TRUE and wrote a 125 MB
dataset into the user cache directory returned by
gerda_cache_dir(). Package checks now make no network
requests and write nothing outside the session’s temporary
directory.clear_gerda_cache() example is likewise
\dontrun{}, since running it deletes files from the user’s
cache directory.No user-facing behaviour changed in this release;
load_gerda_web(), caching, and all data remain as in
0.8.0.
county_council_seats to the catalog (46 → 47
datasets): a yearly panel of county council (Kreistag) seat composition,
400 counties × 18 years (2008–2025), on a fixed set of current county
boundaries. Seat vectors are carried forward between elections;
reform-created counties are missing before they existed.municipal_unharm now includes ten council seat count
columns (seats_cdu_csu, seats_spd,
seats_linke_pds, seats_gruene,
seats_afd, seats_piraten,
seats_fdp, seats_die_partei,
seats_freie_wahler, seats_bsw) where the state
source reports them. Seats are deliberately absent from the harmonized
municipal files: seat counts cannot be meaningfully summed across merged
municipalities.municipal_unharm covers 1984–2026 and
municipal_harm / municipal_harm_25 cover
1990–2026 (previously listed as 1990–2020).load_gerda_web("federal_cty_unharm") now renames the
upstream ags and year columns to
county_code and election_year on load and no
longer keeps the deprecated duplicates. This completes the removal
announced in 0.6.0 (and deferred once in 0.7.0); a one-time message on
load points existing code to the new names.share_50to64_census22 is now
share_50to59_census22, and
share_65plus_census22 is now
share_60plus_census22. Destatis publishes a combined age
60-74 bin, so true 50-64 and 65+ measures cannot be recovered from these
tables.add_gerda_covariates() and
add_gerda_census() now reject numeric or malformed
geographic identifiers. County codes must be five-digit character
strings and municipality AGS codes must be eight-digit character
strings; this prevents joins after leading zeros have been lost. The
helpers also reject destination-column conflicts instead of creating
ambiguous suffixes.unmatched = "warn", "error", or
"ignore" to both enrichment helpers. Exact unmatched row
and unit counts are reported; INKAR election years outside 1995-2022 are
classified separately and retained with missing joined values.gerda_join_diagnostics() to retrieve
machine-readable reports for one or multiple enrichment joins.ltw_wkr_unharm (vote shares) and
ltw_wkr_unharm_long (vote counts), 1990–2026, all 16
states. The state-level counterpart to the federal
federal_wkr_* datasets.landrat_unharm (county-level results) and
landrat_candidates (person-level candidates, with Stichwahl
and candidate attributes), 1945–2026. gerda_data_list()
gains a corresponding election_type value,
landrat.county_elec_harm_21, which
pointed to a file that does not exist upstream (only
county_elec_harm_21_cty and
county_elec_harm_21_muni are published), so calling it
always failed. load_gerda_web("county_elec_harm_21") now
returns an “unknown dataset” message with fuzzy suggestions instead of a
download error.county_elec_harm_21) pass unnoticed.federal_wkr_unharm — vote shares per Wahlkreis x
election x vote (Erst/Zweitstimme), GERDA-style wide format.federal_wkr_unharm_long — the count-level long
version.federal_wkr_2021_on_2025 — the official recomputation
of the 2021 result onto the 2025 Wahlkreis boundaries (previous-election
district strength on current boundaries).wkr_2021_to_2025_crosswalk — the 2021->2025
constituency crosswalk with unchanged /
redrawn / new categories.load_gerda_web() gains four arguments for more robust
downloads (all with getOption() defaults so they can be set
globally):
timeout (default
getOption("gerda.timeout", 300)) makes the previously
hard-coded download timeout configurable.max_retries (default
getOption("gerda.max_retries", 2)) retries failed downloads
with exponential backoff, so up to three attempts are made before giving
up.cache (default
getOption("gerda.cache", FALSE)) caches downloaded datasets
on disk and reuses them on later calls instead of re-downloading. This
is opt-in so the package never writes to user filespace without consent.
Reusing a cached ~4 MB file is roughly 85x faster than re-downloading
it, and the saving is far larger for the multi-hundred-MB harmonized
panels.refresh (default FALSE) forces a fresh
download, updating the cache.gerda_cache_dir() and
clear_gerda_cache() inspect and purge the download cache
(location follows tools::R_user_dir() and honours
R_USER_CACHE_DIR).load_gerda_web()
now detects when a download returns a Git LFS pointer file instead of
the real data (e.g. after a failed media redirect) and returns an
informative, retryable error instead of a cryptic parse failure.gerda_data_list(print_table = FALSE) now returns
structured metadata columns in addition to data_name and
description: election_type,
geographic_level, year_start,
year_end, boundary, formats, and
candidate_info. The printed table is unchanged.file_format = "csv" for the RDS-only targeted
crosswalks) now fails with a clear message naming the available format
instead of hitting a 404.gerda_catalog() function and consumed by both
load_gerda_web() and gerda_data_list(),
eliminating the previously hand-maintained duplicate lists that could
drift.DESCRIPTION now declares tools and
utils in Imports (used for R_user_dir() and
download.file()).federal_cty_unharm
ags and year columns, announced in 0.6.0 for
v0.7, is deferred to v0.8. The
county_code/election_year aliases remain the
recommended columns; the originals are still available.load_gerda_web() and
gerda_data_list():
county_elec_unharm, county_elec_harm_21,
county_elec_harm_21_cty,
county_elec_harm_21_munieuropean_muni_unharm, european_muni_harmmayoral_unharm,
mayoral_harm, mayoral_candidates,
mayor_panel, mayor_panel_harm,
mayor_panel_annual,
mayor_panel_annual_harmmunicipal_harm_25, state_harm_21,
state_harm_23, state_harm_25ags_1990_to_2023_crosswalk,
ags_1990_to_2025_crosswalk,
crosswalk_ags_2021_to_2023,
crosswalk_ags_2021_2022_to_2023,
crosswalk_ags_2023_to_2025 (RDS only),
crosswalk_ags_2023_24_to_2025 (RDS only),
crosswalk_ags_2024_to_2025 (RDS only)ags_area_pop_emp_2023federal_cty_unharm now also exposes
county_code and election_year columns,
matching the schema used by all other county-level GERDA datasets. This
allows the dataset to be piped into add_gerda_covariates()
without manual renaming.ags (5-digit county code) and
year columns remain for backwards compatibility but are
deprecated and scheduled for removal in
v0.7. Please update code that references
federal_cty_unharm$ags or
federal_cty_unharm$year to use county_code and
election_year instead. A one-time message is printed on
each load.load_gerda_web() now downloads datasets to a tempfile
before reading them. This fixes loading of xz-compressed RDS files
(e.g. ags_1990_to_2025_crosswalk), which
readr::read_rds() could not stream from a URL.load_gerda_web() so the larger GERDA files
(mayor_panel_annual_harm,
federal_muni_harm_21) no longer time out on first pull over
slower connections. The user’s original timeout is restored on
exit.add_gerda_covariates() help example, which
grouped on a non-existent county_code_21 column after
merging covariates into municipal data.load_gerda_web() gains an on_error
argument ("warn" default, "stop" for
pipelines). Set options(gerda.on_error = "stop") to flip
the default globally. Previous behaviour (warning + NULL)
is unchanged.party_crosswalk() now lists all 21 available
destinations in the help page and in its error message. A typo like
party_crosswalk(..., "family_nme") now tells you exactly
which column names are valid.gerda_data_list(print_table = TRUE) prints each row on
a single uncut line. Dataset pairs like
federal_muni_harm_21 and federal_muni_harm_25
are now distinguishable by description in narrow terminals.load_gerda_web() help now documents that major-party
vote-share columns do not sum to 1: the remainder is held by
smaller-party columns and the other bucket.left_join() calls don’t trip on year vs
election_year or on the municipal county
column not being a 5-digit AGS code.DESCRIPTION updated to list all six election families
and the correct federal coverage window (federal county-level since
1953).README.md install section documents
build_vignettes = TRUE for development installs from
GitHub.knitr moved from Imports to Suggests (only needed as
VignetteBuilder).tests/testthat/test-load_gerda_web.R split into five
focused files (-validation, -fuzzy,
-extensions, -catalog, -schema)
to keep concerns separable as the catalog grows.federal_cty_unharm alias + deprecation message, and the new
on_error argument. Suite grew from 240 to 300 tests.gerda_census() – access Census 2022 data (10,786
municipalities, 16 variables)gerda_census_codebook() – data dictionary for census
variablesadd_gerda_census() – merge census data with election
data (supports both municipality and county level)stats to Imports (for
weighted.mean() in county-level census aggregation)gerda_covariates and
gerda_census modulesfederal_muni_harm dataset with clear migration
guidancefederal_muni_harm now correctly suggests
federal_muni_harm_21 and
federal_muni_harm_25)gerda_data_list() in all error
messages to help users discover available datasetsgerda_covariates and
gerda_covariates_codebook)add_gerda_covariates() - One-step helper
to merge covariates with election datagerda_covariates() - Access raw covariate
data (400 counties, 20 variables)gerda_covariates_codebook() - View data
dictionary with variable descriptionsfederal_muni_harm_21: Federal elections harmonized to
2021 boundaries (1990-2025)federal_muni_harm_25: Federal elections harmonized to
2025 boundaries (1990-2025)federal_muni_harm dataset (replaced by
boundary-specific versions)federal_muni_harm_21 or
federal_muni_harm_25 depending on their boundary
harmonization needs