get_death_population: Load population and death data, disaggregated by year, state,...

View source: R/get_death_population.R

get_death_populationR Documentation

Load population and death data, disaggregated by year, state, sex and age.

Description

get_death_population function that allows the user to get a demographic dataset of the population and deaths based on the given parameters.

Usage

get_death_population(
  v_state = "National",
  v_year = "2021",
  v_sex = "Total",
  v_age = c(0, 5, 15, 25, 45, 55, 65, 70),
  age_groups = TRUE
)

Arguments

v_state

Character vector specifying the state(s) that the function will return.

v_year

Numeric vector that specifies the year(s) to return. Must have numbers between 1970 and 2050. Default is 2021.

v_sex

Character vector that selects sex. Options: Female, Male and Total.

v_age

Numeric vector that specifies the age(s) to return.

age_groups

Specifies whether to aggregate the output by age groups.

Value

A demographic dataset based on the selected parameters.

Examples

get_death_population(v_state = c("Aguascalientes", "Campeche"),
                     v_year = c(2021, 2046),
                     v_sex = c("Female", "Total"),
                     age_groups = TRUE)

get_death_population(v_state = "National",
                     v_year = c(2021, 2046, 2050),
                     v_sex = "Total",
                     age_groups= FALSE)


PADeCI/demogmx documentation built on Jan. 27, 2024, 6:43 a.m.