audit_summary() converts an audit object created by audit_panel() into a
one-row tibble of panel diagnostics.
Arguments
- x
An object created by
audit_panel().
Value
A one-row tibble with the following columns:
dataName of the audited object.
idName of the panel unit column.
timeName of the time column.
n_unitsNumber of unique panel units.
n_periodsNumber of unique time periods.
observed_rowsNumber of rows in the original data.
observed_id_time_cellsNumber of unique observed unit-time cells.
expected_cellsNumber of cells in the full unit-by-time grid.
missing_cellsNumber of missing unit-time cells.
duplicate_cellsNumber of duplicate unit-time cells.
balancedLogical indicator for whether the panel is balanced.
Details
This function is useful when users want a compact, tabular summary of a panel audit. The resulting tibble can be printed, saved, joined with other metadata, or combined across multiple datasets.
The summary includes the number of units, number of time periods, observed rows, observed unit-time cells, expected unit-time cells, missing cells, duplicate cells, and a logical indicator for whether the panel is balanced.
Examples
audit <- audit_panel(example_panel, id = id, time = year)
audit_summary(audit)
#> # A tibble: 1 × 11
#> data id time n_units n_periods observed_rows observed_id_time_cells
#> <chr> <chr> <chr> <int> <int> <int> <int>
#> 1 example_pa… id year 3 4 9 8
#> # ℹ 4 more variables: expected_cells <int>, missing_cells <int>,
#> # duplicate_cells <int>, balanced <lgl>