get_data_specific_range: Adapt the year and/or age range of the multi-population...

View source: R/get_data_specific_range.R

get_data_specific_rangeR Documentation

Adapt the year and/or age range of the multi-population mortality dataset

Description

This function adapts the year and/or age range of the mortality dataset, as obtained from the function get_mortality_data, for each country in the multi-population model.

Usage

get_data_specific_range(xv, yv, yv_spec, data, country, country_spec)

Arguments

xv

The new vector of ages.

yv

The new vector of years.

yv_spec

The new vector of years for the country of interest.

data

The multi-population mortality dataset.

country

The vector of countries.

country_spec

The country of interest.

Details

The argument data must be (in the same form as) the output from the function get_mortality_data. See european_mortality_data for such an example mortality dataset.

Value

A list containing the following updated objects:

  • $M (male data), $F (female data)

  • $UNI (individual mortality data: $BE (Belgium), $NL (Netherlands), $AT (Austria), ...), $ALL (combined data)

  • $dtx (deaths), $etx (exposures), $wa (weights).

Examples

xv       <- 0:90
yv       <- 1988:2018
yv_spec  <- 1988:2018
data     <- MultiMoMo::european_mortality_data
country  <- names(data$M$UNI)
country_spec <- "BE"

data_new <- get_data_specific_range(xv, yv, yv_spec, data, country, country_spec)


RobbenJ/MultiMoMo documentation built on June 28, 2022, 9:29 p.m.