mT.cleanup: Remove all non-essential data (raw data, etc.) from a...

mT.cleanupR Documentation

Remove all non-essential data (raw data, etc.) from a mortalityTable object

Description

The function mt.cleanup removes all non-essential data from a given mortalityTable object.

Usage

mT.cleanup(object)

## S4 method for signature 'mortalityTable'
mT.cleanup(object)

## S4 method for signature 'mortalityTable.period'
mT.cleanup(object)

## S4 method for signature 'mortalityTable.trendProjection'
mT.cleanup(object)

## S4 method for signature 'array'
mT.cleanup(object)

## S4 method for signature 'list'
mT.cleanup(object)

## S4 method for signature 'pensionTable'
mT.cleanup(object)

## S4 method for signature 'mortalityTable.observed'
mT.cleanup(object)

Arguments

object

The mortalityTable object to be cleaned.

Details

Mortality tables are often generated from raw data, that is smoothed, extrapolated, etc. The mortalityTable class and its implementations can internally store the raw probabilities and the intermediate results and parameters. This method removes those information. All essential information (base table, ages, trend functions, etc.) are preserved.

Removed information includes: * all elements of the object@data list, except for dim * exposures * names of named age, deathProbs and trend vectors

For mortality tables with other mortalityTable components (like pension tables or mixed tables), all components are cleaned.

Methods (by class)

  • mT.cleanup(mortalityTable): Clean up and remove all non-essential data from the mortalityTable object

  • mT.cleanup(mortalityTable.period): Clean up and remove all non-essential data from the mortalityTable.period object

  • mT.cleanup(mortalityTable.trendProjection): Clean up and remove all non-essential data from the mortalityTable.trendProjection object

  • mT.cleanup(array): Clean up and remove all non-essential data from the mortalityTable objects stored in the array

  • mT.cleanup(list): Clean up and remove all non-essential data from the mortalityTable objects stored in the list

  • mT.cleanup(pensionTable): Clean up and remove all non-essential data from the mortalityTable objects stored in the array

  • mT.cleanup(mortalityTable.observed): Clean up the internal data of the mortality table

Examples

mortalityTables.load("Austria_Census")
# Whittaker-Henderson smoothing stores the raw input and the weights in the
# \code{data} slot of the table:
AT.smoothed = whittaker.mortalityTable(mort.AT.census.2011.male)
AT.smoothed@data$rawProbs
AT.smoothed@data$whittaker

# cleaning up the table removes those non-essential information again:
AT.smoothed.clean = mT.cleanup(AT.smoothed)
AT.smoothed.clean@data$rawProbs
AT.smoothed.clean@data$whittaker


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