feat(explain): render new per-capita provenance fields

cog_explain() now prints denominator_source, popyear_range, and
pop_source_counts under the Transformations section.
This commit is contained in:
2026-04-29 19:02:37 -04:00
parent a2ced368f5
commit 916212c327
2 changed files with 25 additions and 0 deletions
+10
View File
@@ -74,6 +74,16 @@ cog_explain <- function(result, format = c("print", "list")) {
pc <- prov$transformations$per_capita
if (isTRUE(pc$applied)) {
cli::cli_text("Per-capita denominator: {pc$denominator_source}")
if (length(pc$popyear_range) == 2L) {
cli::cli_text(
" popyear range: {pc$popyear_range[1]}-{pc$popyear_range[2]}"
)
}
if (!is.null(pc$pop_source_counts)) {
cli::cli_text(
" pop_source counts: census_f33={pc$pop_source_counts$census_f33}, unavailable={pc$pop_source_counts$unavailable}"
)
}
}
infl <- prov$transformations$inflation
if (isTRUE(infl$applied)) {