Commit 1ae9ae42 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer

mortalityTable.joined and mortalityTable.observed are not fully implemented,...

mortalityTable.joined and mortalityTable.observed are not fully implemented, so comment out all occurrences
parent ad064fac
......@@ -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)
......
......@@ -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;
# })
......@@ -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);
# })
#' @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"
# )
#' @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
......@@ -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)
}}
......
......@@ -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))
}
% 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}
}}
% 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}
}}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment