diff --git a/.gitignore b/.gitignore index f6f86183085b92b00729b11bb1435e64e3bf028a..21fb14d0e595530ae6daf9adc284751fc01717d1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ R/Companies/ Formulas_Reference/2013*.xls* inst/doc +desktop.ini diff --git a/DESCRIPTION b/DESCRIPTION index 13ce5c8ffb95fcacddb578726809551a711ce88e..1c6222021bbc18732a9daec056b6859961caf759 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -23,9 +23,8 @@ Description: Classes to implement and plot cohort life tables as well as period life table, cohort life tables using an age shift, and merged life tables. License: GPL (>= 2) -RoxygenNote: 6.0.1 -Collate: - 'mortalityTable.R' +RoxygenNote: 6.1.0.9000 +Collate: 'mortalityTable.R' 'mortalityTable.period.R' 'mortalityTable.ageShift.R' 'ageShift.R' diff --git a/inst/extdata/Austria_Population_Forecast.csv b/inst/extdata/Austria_Population_Forecast.csv index c29c5dedd7e3486318523cd0633ccbe70f3a352e..3847a0f3068f86ddeb4f3db29592508ace1316fe 100644 --- a/inst/extdata/Austria_Population_Forecast.csv +++ b/inst/extdata/Austria_Population_Forecast.csv @@ -1,6 +1,6 @@ Statistik Austria: Bevölkerungsprognose 2014-2080 – Basistafel und jährlicher Trend,,,, ,,,, -,q Männer 2014,Männer,q Frauen 2014,Frauen +,q M 2014,M,q F 2014,F 0,0.00329510385037614,-0.0443394515333271,0.00281572638727908,-0.0461691934651078 1,0.000255226677421527,-0.0428143357006832,0.000162851795562211,-0.0444917353582905 2,0.000173567998795988,-0.0421435262403271,0.000132130160011204,-0.0431499486749107 diff --git a/inst/extdata/MortalityTables_Austria_PopulationForecast.R b/inst/extdata/MortalityTables_Austria_PopulationForecast.R index f595333c3f4d5ad5e2418e154b3c95849b41fe1e..e59268905455d5081d9f0c86afe58ac91442a01b 100644 --- a/inst/extdata/MortalityTables_Austria_PopulationForecast.R +++ b/inst/extdata/MortalityTables_Austria_PopulationForecast.R @@ -7,13 +7,13 @@ stopifnot(require(methods), require(utils), require(MortalityTables)) # Mortalit ############################################################################### -AT.pop.fc = utils::read.csv(system.file("extdata", "Austria_Population_Forecast.csv", package = "MortalityTables"), skip = 2); +AT.pop.fc = utils::read.csv(system.file("extdata", "Austria_Population_Forecast.csv", package = "MortalityTables"), skip = 2, encoding = "UTF-8"); mort.AT.forecast.male = mortalityTable.trendProjection( name = "Österreich Männer (mittl. Sz.)", baseYear = 2014, - deathProbs = AT.pop.fc$q.Männer.2014, - trend = -AT.pop.fc$Männer, + deathProbs = AT.pop.fc$q.M.2014, + trend = -AT.pop.fc$M, ages = AT.pop.fc$X, data = list( dim = list(sex = "m", collar = "Gesamtbevölkerung", type = "Bevölkerungsprognose", data = "official", year = "2014-2080") @@ -22,8 +22,8 @@ mort.AT.forecast.male = mortalityTable.trendProjection( mort.AT.forecast.female = mortalityTable.trendProjection( name = "Österreich Frauen (mittl. Sz.)", baseYear = 2014, - deathProbs = AT.pop.fc$q.Frauen.2014, - trend = -AT.pop.fc$Frauen, + deathProbs = AT.pop.fc$q.F.2014, + trend = -AT.pop.fc$F, ages = AT.pop.fc$X, data = list( dim = list(sex = "w", collar = "Gesamtbevölkerung", type = "Bevölkerungsprognose", data = "official", year = "2014-2080") diff --git a/man/MortalityTables-package.Rd b/man/MortalityTables-package.Rd index d2e5589c80bb1d50eb88f6d122713bb93e2af8bd..84fbefb2b876ab745914e0a76c781bf0941d6a4f 100644 --- a/man/MortalityTables-package.Rd +++ b/man/MortalityTables-package.Rd @@ -6,7 +6,11 @@ \alias{MortalityTables-package} \title{Provide life table classes for life insurance purposes} \description{ -Provide life table classes for life insurance purposes +Classes to implement and plot cohort life tables + for actuarial calculations. In particular, birth-year dependent mortality + tables using a yearly trend to extrapolate from a base year are implemented, + as well as period life table, cohort life tables using an age shift, and + merged life tables. } \seealso{ Useful links: diff --git a/man/calculateImprovements.Rd b/man/calculateImprovements.Rd index 0d35ef69bbedfddcd73cb2dfe24d61a39014f55b..c6737a5f98797ebef05632df5c9610c5b90e6bc1 100644 --- a/man/calculateImprovements.Rd +++ b/man/calculateImprovements.Rd @@ -9,8 +9,9 @@ \usage{ calculateImprovements(object, ...) -\S4method{calculateImprovements}{mortalityTable.improvementFactors}(object, ..., - Period = NULL, YOB = 1982) + + \S4method{calculateImprovements}{mortalityTable.improvementFactors}(object, + ..., Period = NULL, YOB = 1982) } \arguments{ \item{object}{A pension table object (instance of a \code{\linkS4class{mortalityTable.improvementFactors}} class)} diff --git a/man/deathProbabilities.Rd b/man/deathProbabilities.Rd index d5c7025764868873bf6f416107ceace50258db13..3969727345025d5d49b0b641eff827500d9f420d 100644 --- a/man/deathProbabilities.Rd +++ b/man/deathProbabilities.Rd @@ -14,8 +14,8 @@ \usage{ deathProbabilities(object, ..., ages = NULL, YOB = 1975) -\S4method{deathProbabilities}{mortalityTable.period}(object, ..., ages = NULL, - YOB = 1975) +\S4method{deathProbabilities}{mortalityTable.period}(object, ..., + ages = NULL, YOB = 1975) \S4method{deathProbabilities}{mortalityTable.ageShift}(object, ..., ages = NULL, YOB = 1975) @@ -23,11 +23,11 @@ deathProbabilities(object, ..., ages = NULL, YOB = 1975) \S4method{deathProbabilities}{mortalityTable.trendProjection}(object, ..., ages = NULL, YOB = 1975) -\S4method{deathProbabilities}{mortalityTable.improvementFactors}(object, ..., - ages = NULL, YOB = 1975) +\S4method{deathProbabilities}{mortalityTable.improvementFactors}(object, + ..., ages = NULL, YOB = 1975) -\S4method{deathProbabilities}{mortalityTable.mixed}(object, ..., ages = NULL, - YOB = 1975) +\S4method{deathProbabilities}{mortalityTable.mixed}(object, ..., + ages = NULL, YOB = 1975) \S4method{deathProbabilities}{mortalityTable.jointLives}(object, ..., ageDifferences = c(), ages = NULL, YOB = 1975) diff --git a/man/mortalityImprovement.Rd b/man/mortalityImprovement.Rd index 315a26d4bca72f20e535cb2dc4cb2dee6b5f9b1c..1d6983e54a9267403853e73039796b75f544b552 100644 --- a/man/mortalityImprovement.Rd +++ b/man/mortalityImprovement.Rd @@ -8,8 +8,8 @@ \usage{ mortalityImprovement(object, ..., Period = NULL, YOB = 1975) -\S4method{mortalityImprovement}{mortalityTable}(object, ..., Period = NULL, - YOB = 1975) +\S4method{mortalityImprovement}{mortalityTable}(object, ..., + Period = NULL, YOB = 1975) } \arguments{ \item{object}{The life table object (class inherited from mortalityTable)} diff --git a/man/mortalityTable.once.Rd b/man/mortalityTable.once.Rd index e5f0afdca925161f3638e70433103b73beffff35..e82137355f62d07111dc7be178da20fa6b900552 100644 --- a/man/mortalityTable.once.Rd +++ b/man/mortalityTable.once.Rd @@ -4,8 +4,8 @@ \alias{mortalityTable.once} \title{Generate a (deterministic) mortality table with only one probability set to 1 (for the given age)} \usage{ -mortalityTable.once(transitionAge, name = "Deterministic mortality table", - ages = 0:99) +mortalityTable.once(transitionAge, + name = "Deterministic mortality table", ages = 0:99) } \arguments{ \item{transitionAge}{The age where the deterministic transition occurs} diff --git a/man/periodDeathProbabilities.Rd b/man/periodDeathProbabilities.Rd index 5b3f674f09880bf70c42a36556826aa3e20aafc9..bad8d2ae6b16ef0f16be4bf42c8beeb7cfb9affc 100644 --- a/man/periodDeathProbabilities.Rd +++ b/man/periodDeathProbabilities.Rd @@ -21,10 +21,12 @@ periodDeathProbabilities(object, ..., ages = NULL, Period = 1975) \S4method{periodDeathProbabilities}{mortalityTable.ageShift}(object, ..., ages = NULL, Period = 1975) -\S4method{periodDeathProbabilities}{mortalityTable.trendProjection}(object, ..., - ages = NULL, Period = 1975) -\S4method{periodDeathProbabilities}{mortalityTable.improvementFactors}(object, + \S4method{periodDeathProbabilities}{mortalityTable.trendProjection}(object, + ..., ages = NULL, Period = 1975) + + + \S4method{periodDeathProbabilities}{mortalityTable.improvementFactors}(object, ..., ages = NULL, Period = 1975) \S4method{periodDeathProbabilities}{mortalityTable.mixed}(object, ..., diff --git a/man/periodTransitionProbabilities.Rd b/man/periodTransitionProbabilities.Rd index e61a03840c04c099a37e13eb0f2add711feb37d7..d50a399dde8b19200e7b465a656f7572d3c5aaed 100644 --- a/man/periodTransitionProbabilities.Rd +++ b/man/periodTransitionProbabilities.Rd @@ -8,9 +8,10 @@ \usage{ periodTransitionProbabilities(object, ...) -\S4method{periodTransitionProbabilities}{pensionTable}(object, Period = 2017, - ..., ages = NULL, OverallMortality = FALSE, retirement = NULL, - invalids.retire = object@invalids.retire, as.data.frame = TRUE) +\S4method{periodTransitionProbabilities}{pensionTable}(object, + Period = 2017, ..., ages = NULL, OverallMortality = FALSE, + retirement = NULL, invalids.retire = object@invalids.retire, + as.data.frame = TRUE) } \arguments{ \item{object}{A pension table object (instance of a \code{\linkS4class{pensionTable}} class)} diff --git a/man/plotMortalityTables.Rd b/man/plotMortalityTables.Rd index 1ab331ab35d196926812413d58dda71a15a135fd..892ef6ae912dfc83511de4e19e89b085cf3a499b 100644 --- a/man/plotMortalityTables.Rd +++ b/man/plotMortalityTables.Rd @@ -5,10 +5,10 @@ \title{Plot multiple mortality tables (life tables) in one plot} \usage{ plotMortalityTables(data, ..., aes = NULL, ages = NULL, - legend.title = "Sterbetafel", xlim = NULL, ylim = NULL, xlab = NULL, - ylab = NULL, title = "", legend.position = c(0.9, 0.1), - legend.justification = c(1, 0), legend.key.width = unit(25, "mm"), - log = TRUE) + legend.title = "Sterbetafel", xlim = NULL, ylim = NULL, + xlab = NULL, ylab = NULL, title = "", legend.position = c(0.9, + 0.1), legend.justification = c(1, 0), legend.key.width = unit(25, + "mm"), log = TRUE) } \arguments{ \item{data}{First life table to be plotted. Either a \code{data.frame} generated by \code{makeQxDataFrame} or a \code{mortalityTable} object}