aggregate_population_estimates: Aggregate population estimates

View source: R/aggregate_population_estimates.R

aggregate_population_estimatesR Documentation

Aggregate population estimates

Description

Aggregate population estimates

Usage

aggregate_population_estimates(estimate, period, strata, from, to)

Arguments

estimate

Numeric. Population estimate

period

Integer. Numeric codes for the corresponding period. See period_cd

strata

Atomic. Population strata

from

Character. Current level. "cy", "fy", "cq", "fq", "cm", "fm"

to

Character. Desired level. "cy", "fy", "cq", "fq", "cm", "fm"

Value

A data frame

Examples

dfr <- data.frame(
  ccg_cd = "E92001",
  cyear = c(2021, 2011),
  mid_yr_est = c(1457775, 1457783))


aggregate_population_estimates(
  strata = dfr$ccg_cd,
  estimate = dfr$mid_yr_est,
  period = dfr$cyear,
  from = "cy",
  to = "cq"
)

aggregate_population_estimates(
  strata = dfr$ccg_cd,
  estimate = dfr$mid_yr_est,
  period = dfr$cyear,
  from = "cy",
  to = "fq"
)

aggregate_population_estimates(
  strata = dfr$ccg_cd,
  estimate = dfr$mid_yr_est,
  period = dfr$cyear,
  from = "cy",
  to = "cm"
)

aggregate_population_estimates(
  strata = dfr$ccg_cd,
  estimate = dfr$mid_yr_est,
  period = dfr$cyear,
  from = "cy",
  to = "fm"
)

OlisaNsonwu/jurithy documentation built on Nov. 28, 2023, 3:39 a.m.