fillAges: Fill the given probabilities with NA to match the desired age...

View source: R/fillAges.R

fillAgesR Documentation

Fill the given probabilities with NA to match the desired age range.

Description

Fill the given probabilities with NA to match the desired age range.

Usage

fillAges(probs = c(), givenAges = c(), neededAges = NULL, fill = NA_real_)

Arguments

probs

Numeric vector

givenAges

ages assigned to the given vector

neededAges

desired age range for output

fill

If set, missing values will be replaced with this value. Default is to fill with NA.

Examples

# Ages 20-70 have linearly increasing death probabilities. Fill with 0 for the whole age range 0-120
fillAges(probs = c(0:50/50), givenAges = 20:70, neededAges = 0:120, fill = 0)


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