Skip to content
Snippets Groups Projects
Commit 7803d1ad authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

add pensionTable.NA to indicate an empty pension table

parent a87e1a8a
No related branches found
No related tags found
No related merge requests found
......@@ -90,6 +90,16 @@ pensionTable = setClass(
probs.arrange = "function"
),
prototype = list(
qx = mortalityTable.NA,
ix = mortalityTable.NA,
qix = mortalityTable.NA,
rx = mortalityTable.NA,
apx = mortalityTable.NA,
qpx = mortalityTable.NA,
hx = mortalityTable.NA,
qwy = mortalityTable.NA,
yx = mortalityTable.NA,
qgx = mortalityTable.NA,
invalids.retire = FALSE,
probs.arrange = pensionTableProbArrange
),
......@@ -267,6 +277,13 @@ setMethod("periodTransitionProbabilities", "pensionTable",
})
#' Empty pension table indicating NA
#'
#' @export
pensionTable.NA = pensionTable()
if (FALSE) {
pensionTables.load("Austria_AVOe2008P")
transitionProbabilities(AVOe2008P.male, YOB = 1977, as.data.frame = FALSE)
......
......@@ -7,6 +7,17 @@ stopifnot(require(methods), require(utils), require(MortalityTables), require(re
# Pension Table AVÖ 1999P ----
############################################################################### #
AVOe1999P = array(
data = c(pensionTable.NA),
dim = c(2, 2),
dimnames = list(Geschlecht = c("m", "w"), Bestand = c("Angestellte", "Mischbestand"))
)
AVOe1999PK = array(
data = c(pensionTable.NA),
dim = c(2, 2),
dimnames = list(Geschlecht = c("m", "w"), Bestand = c("Angestellte", "Mischbestand"))
)
if (is.null(getOption("MortalityTables.AVOe1999P"))) {
message("The pension table AVÖ 1999P requires the Excel file 'Austria_Pensions_AVOe1999P.xlsx'. Please set its path with options(\"MortalityTables.AVOe1999P\" = \"/path/to/Austria_Pensions_AVOe1999P.xlsx\").")
} else {
......@@ -106,16 +117,6 @@ AVOe1999P.generate = function(tab, name="P", collar = "Angestellte") {
# Die Tafel als Array ----
############################################################################## #
AVOe1999P = array(
data = c(mortalityTable.NA),
dim = c(2, 2),
dimnames = list(Geschlecht = c("m", "w"), Bestand = c("Angestellte", "Mischbestand"))
)
AVOe1999PK = array(
data = c(mortalityTable.NA),
dim = c(2, 2),
dimnames = list(Geschlecht = c("m", "w"), Bestand = c("Angestellte", "Mischbestand"))
)
AVOe1999P[, "Angestellte"] = AVOe1999P.generate(tab = "Angestellte", "P", collar = "Angestellte")
AVOe1999P[, "Mischbestand"] = AVOe1999P.generate(tab = "Arbeiter+Angestellte", "P Arb./Ang.", collar = "Mischbestand")
AVOe1999PK[, "Angestellte"] = AVOe1999P.generate(tab = "Angestellte PK", "PK", collar = "Angestellte")
......
......@@ -7,6 +7,18 @@ stopifnot(require(methods), require(utils), require(MortalityTables), require(re
# AVÖ 2008P exact (Male, Female)
###############################################################################
AVOe2008P = array(
data = c(pensionTable.NA),
dim = c(2, 2),
dimnames = list(Geschlecht = c("m", "w"), Bestand = c("Angestellte", "Mischbestand"))
)
AVOe2008PK = array(
data = c(pensionTable.NA),
dim = c(2, 2),
dimnames = list(Geschlecht = c("m", "w"), Bestand = c("Angestellte", "Mischbestand"))
)
if (is.null(getOption("MortalityTables.AVOe2008P"))) {
message("The pension table AVÖ 1999P requires the Excel file 'Austria_Pensions_AVOe2008P.xlsx'. Please set its path with options(\"MortalityTables.AVOe2008P\" = \"/path/to/Austria_Pensions_AVOe2008P.xlsx\").")
} else {
......@@ -183,17 +195,6 @@ AVOe2008P.generate = function(tab, name = "P", collar = "Angestellte") {
# Die Tafel als Array ----
############################################################################## #
AVOe2008P = array(
data = c(mortalityTable.NA),
dim = c(2, 2),
dimnames = list(Geschlecht = c("m", "w"), Bestand = c("Angestellte", "Mischbestand"))
)
AVOe2008PK = array(
data = c(mortalityTable.NA),
dim = c(2, 2),
dimnames = list(Geschlecht = c("m", "w"), Bestand = c("Angestellte", "Mischbestand"))
)
AVOe2008P[, "Angestellte"] = AVOe2008P.generate("Angestellte", "P", collar = "Angestellte")
AVOe2008P[, "Mischbestand"] = AVOe2008P.generate("Arbeiter+Angestellte", "P Arb./Ang.", collar = "Mischbestand")
AVOe2008PK[, "Angestellte"] = AVOe2008P.generate("Angestellte PK", "P", collar = "Angestellte")
......
......@@ -9,15 +9,16 @@ stopifnot(require(methods), require(utils), require(MortalityTables), require(dp
# Pension Table AVÖ 2018-P ----
############################################################################### #
AVOe2018P = array(
data = c(pensionTable.NA),
dim = c(3, 2, 2),
dimnames = list(Geschlecht = c("m", "w", "u"), Bestand = c("Angestellte", "Mischbestand"), Invalidisierung = c("IP", "IPRG"))
)
if (is.null(getOption("MortalityTables.AVOe2018PAng")) && is.null(getOption("MortalityTables.AVOe2018PMisch"))) {
message("The pension table AVOe2018P requires the Excel files 'AVOe2018P_Pensionstafeln_Angestellte.xlsx' or 'AVOe2018P_Pensionstafeln_Mischbestand.xlsx'. Please set the paths to them with options(\"MortalityTables.AVOe2018PAng\" = \"/path/to/AVOe2018P_Pensionstafeln_Angestellte.xlsx\") and options(\"MortalityTables.AVOe2018PMisch\" = \"..\").")
} else {
AVOe2018P = array(
data = c(mortalityTable.NA),
dim = c(3, 2, 2),
dimnames = list(Geschlecht = c("m", "w", "u"), Bestand = c("Angestellte", "Mischbestand"), Invalidisierung = c("IP", "IPRG"))
)
#------------------------------------------------------------------------------- -
# Functions to load the tables (raw base tables and trend) and the additional info ----
......
......@@ -10,6 +10,8 @@ stopifnot(require(methods), require(utils), require(MortalityTables), require(re
if (is.null(getOption("MortalityTables.EttlPagler"))) {
message("The pension table EttlPagler requires the Excel file 'Austria_Pensions_EttlPagler.xlsx'. Please set its path with options(\"MortalityTables.EttlPagler\" = \"/path/to/Austria_Pensions_EttlPagler.xlsx\").")
EttlPagler = c(m = pensionTable.NA, w = pensionTable.NA)
} else {
###############################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment