mT.setDimInfo: Set additional information (year, description, type of risk,...

Description Usage Arguments Examples

View source: R/utilityFunctions.R

Description

A mortalityTable can store additional information to be used e.g. as additional dimensions in ggplot calls. Typically, these information include sex, base population, observation year, type of data (raw, smoothed), country, type of risk, etc. These additional dimensions are stored in the tbl@data list and will be used by plotMortalityTables and similar functions.

Usage

1

Arguments

tbl

The mortalityTable object to assign dimensional information

...

The dimensional information as named arguments. All names except tbl and append are allowed.

append

Whether to append to existing dimensional data (append=TRUE) or completely replace existing information (append=FALSE)

Examples

1
2
3
4
5
6
7
8
9
mortalityTables.load("Austria_Census")
mortalityTables.load("Austria_Annuities")
# The annuity tables use the population mortality as starting point. Set either
# population or anuuitants as dimensional info and use that dimension in a ggplot
# Most pre-defined tables already have the most important dimensions (like sex) stored.
at01.m = mT.setDimInfo(mort.AT.census.2001.male, population = "Population")
at01.f = mT.setDimInfo(mort.AT.census.2001.female, population = "Population")
av05r.m = mT.setDimInfo(AVOe2005R.male, population = "Annuitants")
plotMortalityTables(at01.m, at01.f, av05r.m) + aes(linetype = population, color = sex)

kainhofer/r-mortality-tables documentation built on Dec. 17, 2020, 3:53 a.m.