mT.fillAges: Restrict/expand a mortalityTable to certain ages

View source: R/utilityFunctions.R

mT.fillAgesR Documentation

Restrict/expand a mortalityTable to certain ages

Description

Restrict the given mortalityTable object(s) to given ages, potentially filling with NA values to ensure they cover the full desired age range

Usage

mT.fillAges(table, neededAges, fill = 0)

Arguments

table

A life table object (instance of a mortalityTable class) or a list, table or array of mortalityTable objects

neededAges

The vector of ages the returned objects should cover (even if the values are 0 or NA)

fill

The value to use for all ages for which the original table(s) do not have any information

Examples

mortalityTables.load("Austria_Annuities")
# return a table with only ages 100-130, where ages above 120 (not defined
# in the original table) are filled with qx=1:
mT.fillAges(AVOe2005R.male, neededAges = 100:130, fill = 1)


MortalityTables documentation built on Nov. 2, 2023, 5:52 p.m.