Checks: cells with no usable source population (flagged for audit, not treated as an error); no other negative/NA exposures; exposure should not exceed 2x population (a generous plausibility bound).

validate_exposure(exposure_df, population_df)

Arguments

exposure_df

Output of the data element of compute_exposure().

population_df

The population tibble originally passed in.

Value

list(passed = logical, issues = named list of flagged tibbles).

Examples

exposure_df <- tibble::tibble(
  nuts3_code = "ES611", year = 2020, age = c(0, 1),
  female = c(495, 480), male = c(520, 500), total = c(1015, 980),
  is_boundary_year = FALSE, is_missing_source_pop = FALSE
)
population_df <- tibble::tibble(
  nuts3_code = "ES611", year = 2020, age = c(0, 1), total = c(1000, 970)
)
validate_exposure(exposure_df, population_df)
#> All exposure validation checks passed.
#> $passed
#> [1] TRUE
#> 
#> $issues
#> list()
#>