From 1ae9ae42c9a59e8edb4a908127c9d1822d6c5d16 Mon Sep 17 00:00:00 2001
From: Reinhold Kainhofer <reinhold@kainhofer.com>
Date: Mon, 11 Sep 2017 00:17:37 +0000
Subject: [PATCH] mortalityTable.joined and mortalityTable.observed are not
 fully implemented, so comment out all occurrences

---
 NAMESPACE                            |  4 --
 R/ages.R                             | 24 ++++++------
 R/getOmega.R                         | 29 ++++++++------
 R/mortalityTable.joined.R            | 56 ++++++++++++++++------------
 R/mortalityTable.observed.R          | 51 ++++++++++++-------------
 man/ages.Rd                          | 10 -----
 man/getOmega.Rd                      | 16 +++-----
 man/mortalityTable.joined-class.Rd   | 24 ------------
 man/mortalityTable.observed-class.Rd | 21 -----------
 9 files changed, 94 insertions(+), 141 deletions(-)
 delete mode 100644 man/mortalityTable.joined-class.Rd
 delete mode 100644 man/mortalityTable.observed-class.Rd

diff --git a/NAMESPACE b/NAMESPACE
index 698b724..bbffe45 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -11,10 +11,8 @@ export(mortalityTable.Weibull)
 export(mortalityTable.ageShift)
 export(mortalityTable.deMoivre)
 export(mortalityTable.improvementFactors)
-export(mortalityTable.joined)
 export(mortalityTable.jointLives)
 export(mortalityTable.mixed)
-export(mortalityTable.observed)
 export(mortalityTable.once)
 export(mortalityTable.onceAndFuture)
 export(mortalityTable.period)
@@ -34,10 +32,8 @@ exportClasses(mortalityTable.Weibull)
 exportClasses(mortalityTable.ageShift)
 exportClasses(mortalityTable.deMoivre)
 exportClasses(mortalityTable.improvementFactors)
-exportClasses(mortalityTable.joined)
 exportClasses(mortalityTable.jointLives)
 exportClasses(mortalityTable.mixed)
-exportClasses(mortalityTable.observed)
 exportClasses(mortalityTable.period)
 exportClasses(mortalityTable.trendProjection)
 exportClasses(pensionTable)
diff --git a/R/ages.R b/R/ages.R
index 4edd72f..e20489d 100644
--- a/R/ages.R
+++ b/R/ages.R
@@ -18,25 +18,25 @@ setGeneric("ages", function(object, ...) standardGeneric("ages"));
 
 #' @describeIn ages Return the defined ages of the period life table
 setMethod("ages", "mortalityTable.period",
-          function (object, ...) {
+          function(object, ...) {
               object@ages;
           })
 
 #' @describeIn ages Return the defined ages of the mixed life table
 setMethod("ages", "mortalityTable.mixed",
-          function (object, ...) {
+          function(object, ...) {
               ages(object@table1);
           })
 
-#' @describeIn ages Return the defined ages of the joined life table
-setMethod("ages", "mortalityTable.joined",
-          function (object, ...) {
-              ages(object@table1);
-          })
+# #' @describeIn ages Return the defined ages of the joined life table
+# setMethod("ages", "mortalityTable.joined",
+#           function (object, ...) {
+#               ages(object@table1);
+#           })
 
-#' @describeIn ages Return the defined ages of the observed life table
-setMethod("ages", "mortalityTable.observed",
-          function (object, ...) {
-              object@ages;
-          })
+# #' @describeIn ages Return the defined ages of the observed life table
+# setMethod("ages", "mortalityTable.observed",
+#           function(object, ...) {
+#               object@ages;
+#           })
 
diff --git a/R/getOmega.R b/R/getOmega.R
index e2cf6bc..fdc01b2 100644
--- a/R/getOmega.R
+++ b/R/getOmega.R
@@ -5,29 +5,34 @@ NULL
 #'
 #' @param object A life table object (instance of a \code{mortalityTable} class)
 #'
+#' @examples
+#' mortalityTables.load("Austria_Annuities")
+#' getOmega(AVOe2005R.male)
+#' getOmega(mortalityTable.deMoivre(omega = 100))
+#'
 #' @exportMethod getOmega
 setGeneric("getOmega", function(object) standardGeneric("getOmega"));
 
 #' @describeIn getOmega Return the maximum age of the period life table
 setMethod("getOmega", "mortalityTable.period",
-          function (object) {
+          function(object) {
               max(object@ages, na.rm = TRUE);
           })
 
 #' @describeIn getOmega Return the maximum age of the mixed life table
 setMethod("getOmega", "mortalityTable.mixed",
-          function (object) {
+          function(object) {
               getOmega(object@table1);
           })
 
-#' @describeIn getOmega Return the maximum age of the joined life table
-setMethod("getOmega", "mortalityTable.joined",
-          function (object) {
-              getOmega(object@table1);
-          })
+# #' @describeIn getOmega Return the maximum age of the joined life table
+# setMethod("getOmega", "mortalityTable.joined",
+#           function(object) {
+#               getOmega(object@table1);
+#           })
 
-#' @describeIn getOmega Return the maximum age of the joined life table
-setMethod("getOmega", "mortalityTable.observed",
-          function (object) {
-              max(object@ages, na.rm = TRUE);
-          })
+# #' @describeIn getOmega Return the maximum age of the joined life table
+# setMethod("getOmega", "mortalityTable.observed",
+#           function(object) {
+#               max(object@ages, na.rm = TRUE);
+#           })
diff --git a/R/mortalityTable.joined.R b/R/mortalityTable.joined.R
index 532a210..743664b 100644
--- a/R/mortalityTable.joined.R
+++ b/R/mortalityTable.joined.R
@@ -1,26 +1,36 @@
 #' @include mortalityTable.R
 NULL
 
-#' Class mortalityTable.joined - Life table created by joining two life tables
-#'
-#' A cohort life table obtained by joining two cohort life tables, each of which
-#' applies only to certain observation years (e.g. for the past use the observed
-#' PoDs, and project them to the future with the trend projection)
-#'
-#' @slot table1 The first \code{mortalityTable}, valid for years given in \code{yearRange1}
-#' @slot yearRange1 The years, for which \code{table1} describes the death probabilities
-#' @slot table2 The second \code{mortalityTable}, valid for years given in \code{yearRange2}
-#' @slot yearRange2 The years, for which \code{table2} describes the death probabilities
-#'
-#' @export mortalityTable.joined
-#' @exportClass mortalityTable.joined
-mortalityTable.joined = setClass(
-    "mortalityTable.joined",
-    slots=list(
-        table1 = "mortalityTable",
-        yearRange1 = "numeric",
-        table2 = "mortalityTable",
-        yearRange2 = "numeric"
-    ),
-    contains = "mortalityTable"
-)
+
+# #' Class mortalityTable.joined - Life table created by joining two life tables
+# #'
+# #' A cohort life table obtained by joining two cohort life tables, each of which
+# #' applies only to certain observation years (e.g. for the past use the observed
+# #' PoDs, and project them to the future with the trend projection)
+# #'
+# #' @slot table1 The first \code{mortalityTable}, valid for years given in \code{yearRange1}
+# #' @slot yearRange1 The years, for which \code{table1} describes the death probabilities
+# #' @slot table2 The second \code{mortalityTable}, valid for years given in \code{yearRange2}
+# #' @slot yearRange2 The years, for which \code{table2} describes the death probabilities
+# #'
+# #' @examples
+# #' mortalityTables.load("Austria_Annuities")
+# #' # An annuity table with different underlying tables for years <2005 and >=2005
+# #' lt = mortalityTable.joined(table1 = AVOe1996R.male, yearRange1 = 1900:2004,
+# #'                            table2 = AVOe2005R.male, yearRange2 = 2005:2090,
+# #'                            name = "Austrian annuities, joined from '96 and '05 tables")
+# #' plot(lt, AVOe1996R.male, AVOe2005R.male, YOB = 1982)
+# #'
+# #' @export mortalityTable.joined
+# #' @exportClass mortalityTable.joined
+# mortalityTable.joined = setClass(
+#     "mortalityTable.joined",
+#     slots = list(
+#         table1 = "mortalityTable",
+#         yearRange1 = "numeric",
+#         table2 = "mortalityTable",
+#         yearRange2 = "numeric"
+#     ),
+#     contains = "mortalityTable"
+# )
+
diff --git a/R/mortalityTable.observed.R b/R/mortalityTable.observed.R
index de6d4fc..39c89bb 100644
--- a/R/mortalityTable.observed.R
+++ b/R/mortalityTable.observed.R
@@ -1,28 +1,29 @@
 #' @include mortalityTable.R
 NULL
 
-#' Class mortalityTable.observed - Life table from actual observations
-#'
-#' A cohort life table described by actual observations (data frame of PODs
-#' per year and age)
-#'
-#' @slot data    The observations
-#' @slot years   The observation years
-#' @slot ages    The observation ages
-#'
-#' @export mortalityTable.observed
-#' @exportClass mortalityTable.observed
-mortalityTable.observed = setClass(
-    "mortalityTable.observed",
-    slots = list(
-        data = "data.frame",
-        years = "numeric",
-        ages = "numeric"
-    ),
-    prototype = list(
-        data = data.frame(),
-        years = c(),
-        ages = c()
-    ),
-    contains = "mortalityTable"
-)
+# #' Class mortalityTable.observed - Life table from actual observations
+# #'
+# #' A cohort life table described by actual observations (data frame of PODs
+# #' per year and age)
+# #'
+# #' @slot data    The observations
+# #' @slot years   The observation years
+# #' @slot ages    The observation ages
+# #'
+# #' @export mortalityTable.observed
+# #' @exportClass mortalityTable.observed
+# mortalityTable.observed = setClass(
+#     "mortalityTable.observed",
+#     slots = list(
+#         data = "data.frame",
+#         years = "numeric",
+#         ages = "numeric"
+#     ),
+#     prototype = list(
+#         data = data.frame(),
+#         years = c(),
+#         ages = c()
+#     ),
+#     contains = "mortalityTable"
+# )
+# asdf
diff --git a/man/ages.Rd b/man/ages.Rd
index 060e281..822dfd2 100644
--- a/man/ages.Rd
+++ b/man/ages.Rd
@@ -5,8 +5,6 @@
 \alias{ages}
 \alias{ages,mortalityTable.period-method}
 \alias{ages,mortalityTable.mixed-method}
-\alias{ages,mortalityTable.joined-method}
-\alias{ages,mortalityTable.observed-method}
 \alias{ages,mortalityTable.jointLives-method}
 \title{Return the defined ages of the life table}
 \usage{
@@ -16,10 +14,6 @@ ages(object, ...)
 
 \S4method{ages}{mortalityTable.mixed}(object, ...)
 
-\S4method{ages}{mortalityTable.joined}(object, ...)
-
-\S4method{ages}{mortalityTable.observed}(object, ...)
-
 \S4method{ages}{mortalityTable.jointLives}(object, ...)
 }
 \arguments{
@@ -36,10 +30,6 @@ Return the defined ages of the life table
 
 \item \code{mortalityTable.mixed}: Return the defined ages of the mixed life table
 
-\item \code{mortalityTable.joined}: Return the defined ages of the joined life table
-
-\item \code{mortalityTable.observed}: Return the defined ages of the observed life table
-
 \item \code{mortalityTable.jointLives}: Return the defined ages of the joint lives mortality table (returns the ages of the first table used for joint lives)
 }}
 
diff --git a/man/getOmega.Rd b/man/getOmega.Rd
index da89593..5439dea 100644
--- a/man/getOmega.Rd
+++ b/man/getOmega.Rd
@@ -5,8 +5,6 @@
 \alias{getOmega}
 \alias{getOmega,mortalityTable.period-method}
 \alias{getOmega,mortalityTable.mixed-method}
-\alias{getOmega,mortalityTable.joined-method}
-\alias{getOmega,mortalityTable.observed-method}
 \alias{getOmega,mortalityTable.jointLives-method}
 \title{Return the maximum age of the life table}
 \usage{
@@ -16,10 +14,6 @@ getOmega(object)
 
 \S4method{getOmega}{mortalityTable.mixed}(object)
 
-\S4method{getOmega}{mortalityTable.joined}(object)
-
-\S4method{getOmega}{mortalityTable.observed}(object)
-
 \S4method{getOmega}{mortalityTable.jointLives}(object)
 }
 \arguments{
@@ -34,10 +28,12 @@ Return the maximum age of the life table
 
 \item \code{mortalityTable.mixed}: Return the maximum age of the mixed life table
 
-\item \code{mortalityTable.joined}: Return the maximum age of the joined life table
-
-\item \code{mortalityTable.observed}: Return the maximum age of the joined life table
-
 \item \code{mortalityTable.jointLives}: Return the maximum age of the joint lives mortality table (returns the maximum age of the first table used for joint lives, as the ages of the joint lives are now known to the function)
 }}
 
+\examples{
+mortalityTables.load("Austria_Annuities")
+getOmega(AVOe2005R.male)
+getOmega(mortalityTable.deMoivre(omega = 100))
+
+}
diff --git a/man/mortalityTable.joined-class.Rd b/man/mortalityTable.joined-class.Rd
deleted file mode 100644
index 5f4c481..0000000
--- a/man/mortalityTable.joined-class.Rd
+++ /dev/null
@@ -1,24 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/mortalityTable.joined.R
-\docType{class}
-\name{mortalityTable.joined-class}
-\alias{mortalityTable.joined-class}
-\alias{mortalityTable.joined}
-\title{Class mortalityTable.joined - Life table created by joining two life tables}
-\description{
-A cohort life table obtained by joining two cohort life tables, each of which
-applies only to certain observation years (e.g. for the past use the observed
-PoDs, and project them to the future with the trend projection)
-}
-\section{Slots}{
-
-\describe{
-\item{\code{table1}}{The first \code{mortalityTable}, valid for years given in \code{yearRange1}}
-
-\item{\code{yearRange1}}{The years, for which \code{table1} describes the death probabilities}
-
-\item{\code{table2}}{The second \code{mortalityTable}, valid for years given in \code{yearRange2}}
-
-\item{\code{yearRange2}}{The years, for which \code{table2} describes the death probabilities}
-}}
-
diff --git a/man/mortalityTable.observed-class.Rd b/man/mortalityTable.observed-class.Rd
deleted file mode 100644
index f02407c..0000000
--- a/man/mortalityTable.observed-class.Rd
+++ /dev/null
@@ -1,21 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/mortalityTable.observed.R
-\docType{class}
-\name{mortalityTable.observed-class}
-\alias{mortalityTable.observed-class}
-\alias{mortalityTable.observed}
-\title{Class mortalityTable.observed - Life table from actual observations}
-\description{
-A cohort life table described by actual observations (data frame of PODs
-per year and age)
-}
-\section{Slots}{
-
-\describe{
-\item{\code{data}}{The observations}
-
-\item{\code{years}}{The observation years}
-
-\item{\code{ages}}{The observation ages}
-}}
-
-- 
GitLab