gerda_join_diagnostics: Inspect GERDA Join Diagnostics

View source: R/gerda_join.R

gerda_join_diagnosticsR Documentation

Inspect GERDA Join Diagnostics

Description

Returns the machine-readable reports attached by add_gerda_covariates() and add_gerda_census(). Both helpers preserve earlier reports, so a pipe that performs both joins returns one row per join in execution order.

Usage

gerda_join_diagnostics(x)

Arguments

x

A data frame returned by add_gerda_covariates() or add_gerda_census().

Details

The diagnostics are stored as an attribute and are intended to be inspected immediately after the join pipeline. The GERDA join helpers preserve the full history, but unrelated data-frame transformations may remove custom attributes.

Value

A tibble with one row per GERDA join and the following columns:

helper, data_level, identifier, join_keys

The helper, inferred geographic level, identifier column, and join-key mapping. join_keys is a list-column.

input_rows, output_rows

Row counts before and after the join.

eligible_rows, matched_rows, unmatched_rows

Rows eligible for matching after excluding temporal out-of-coverage rows, plus total matched and unmatched rows. Census joins treat every row as eligible.

outside_coverage_rows, unexpected_unmatched_rows, missing_key_rows

Unmatched-row classifications. A missing join key is unexpected, even when another key would fall outside coverage.

matched_units, unmatched_units, outside_coverage_units, unexpected_unmatched_units

Counts of distinct non-missing geographic identifiers in each category.

eligible_match_rate

Matched eligible rows divided by all eligible rows, or NA if there are no eligible rows.

coverage_start, coverage_end

Temporal reference-data coverage; NA for the time-invariant Census join.

unmatched_action

The requested unmatched mode.

unexpected_unmatched_identifiers, outside_coverage_years

List-columns containing the distinct values in each category. Missing identifiers are counted in missing_key_rows but cannot appear in the identifier list.

See Also

add_gerda_covariates(), add_gerda_census()

Examples

census <- gerda_census()
election_data <- data.frame(ags = head(census$ags, 2))
joined <- add_gerda_census(election_data, unmatched = "error")
gerda_join_diagnostics(joined)


gerda documentation built on July 27, 2026, 5:09 p.m.