R/abridged_life_tables.R
validate_abridged_life_table.RdFails when any column is missing or non-finite, lx increases, Lx
or ex is not positive, qx lies outside [0, 1], or the identity
mx = dx / Lx fails in a closed interval from age 5 upward (the 0-4
group is built from single-year rates, so its grouped mx need not
satisfy it exactly).
validate_abridged_life_table(alt)Output of build_abridged_life_table() for one year.
list(passed = logical, issues = named list of flagged tibbles).
mx1 <- data.frame(age = 0:4, mx = c(0.004, 0.0003, 0.0002, 0.0002, 0.0002))
mx5 <- data.frame(
age_group = c("00-04", "05-09", "100+"), mx = c(0.0006, 0.0001, 0.35)
)
alt <- build_abridged_life_table(mx1, mx5, "female")
validate_abridged_life_table(alt)
#> $passed
#> [1] TRUE
#>
#> $issues
#> list()
#>