diff --git a/R/pensionTable.R b/R/pensionTable.R index 447267161dbf020307fbaf3b694c88c7e510c9ab..620555b7d26287796398ff8c3084483efef77bfe 100644 --- a/R/pensionTable.R +++ b/R/pensionTable.R @@ -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) diff --git a/inst/extdata/PensionTables_Austria_AVOe1999P.R b/inst/extdata/PensionTables_Austria_AVOe1999P.R index 72c946e9ac395ded2f94c1be891af7cd5e289d88..0c18fa9abfd77713f98ec0dfc7be567081fbb6e0 100644 --- a/inst/extdata/PensionTables_Austria_AVOe1999P.R +++ b/inst/extdata/PensionTables_Austria_AVOe1999P.R @@ -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") diff --git a/inst/extdata/PensionTables_Austria_AVOe2008P.R b/inst/extdata/PensionTables_Austria_AVOe2008P.R index 34cc76a67eabd0beaaa97b4bfb0f13d1d5797c86..d3dd7717f2ade0ea4605777e824ea9761a335fc0 100644 --- a/inst/extdata/PensionTables_Austria_AVOe2008P.R +++ b/inst/extdata/PensionTables_Austria_AVOe2008P.R @@ -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") diff --git a/inst/extdata/PensionTables_Austria_AVOe2018P.R b/inst/extdata/PensionTables_Austria_AVOe2018P.R index 145b860b1be0b07edf3850032c8d7da4d7a6c8d4..d650fe4682a3f73726de673a362918c273bd51e8 100644 --- a/inst/extdata/PensionTables_Austria_AVOe2018P.R +++ b/inst/extdata/PensionTables_Austria_AVOe2018P.R @@ -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 ---- diff --git a/inst/extdata/PensionTables_Austria_EttlPagler.R b/inst/extdata/PensionTables_Austria_EttlPagler.R index 72553aad9ea688f89e3c0cf0b20b8ed37377ca4e..63d63f8cb7c6aedc426775448f0e83ad18f10d26 100644 --- a/inst/extdata/PensionTables_Austria_EttlPagler.R +++ b/inst/extdata/PensionTables_Austria_EttlPagler.R @@ -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 { ###############################################################################