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

View source: R/get_deaths.R

get_deathsR Documentation

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

Description

get_deaths is a function that allows the user to get a demographic dataset containing deaths and death rates, based on the given paramaters.

Usage

get_deaths(
  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.

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_deaths(v_state =  "Chiapas",
           v_year = 2015,
           v_sex = "Total",
           v_age = c(0, 15, 45, 75),
           age_groups = FALSE)

get_deaths(v_state = c("Aguascalientes", "Campeche"),
           v_year = c(2010, 2021),
           v_sex = "Male",
           v_age = c(0, 15, 45, 75),
           age_groups = TRUE)


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