Skip to contents

get_filtered_population() filters the population based on age and level and projects the population base on the year provided

Usage

get_filtered_population(
  year,
  min_age,
  max_age,
  modifier = 1,
  level = c("country", "county", "subcounty"),
  pop_sex = c("female", "male", "both"),
  rate = 0.022
)

Arguments

year

The year to project the population

min_age

The minimum age to include in the filtered data

max_age

The maximum age to include in the filtered data

modifier

A multiplier that affect the population projection. Default 1

level

The desired level of the organization unit hierarchy to retrieve data for: "country", "county" or "subcounty".

pop_sex

The desired population sex: "male", "female" (default), "both"

rate

The population growth

Value

A tibble containing the target population

Examples


# Get the female population in 2022 aged 25-49 years
filtered_population <- get_filtered_population(2022, 25, 49, pop_sex = 'female')
filtered_population
#> # A tibble: 1 × 2
#>   country   target
#>   <chr>      <dbl>
#> 1 Kenya   7294076.

# Get 5% male population in 2022 aged 40-75 years
filtered_population <- get_filtered_population(2022, 40, 75, modifier = 0.05, pop_sex = 'male')
filtered_population
#> # A tibble: 1 × 2
#>   country  target
#>   <chr>     <dbl>
#> 1 Kenya   221010.