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

ageShift: Return NA for mortalityTables without age shift

parent e6ec9ce1
No related branches found
No related tags found
No related merge requests found
......@@ -12,10 +12,18 @@ NULL
#' ageShift(AVOe2005R.male.av, YOB=1910)
#' ageShift(AVOe2005R.male.av, YOB=1955)
#' ageShift(AVOe2005R.male.av, YOB=2010)
#' # A table with trend does NOT have any age shift, so NA is returned:
#' ageShift(AVOe2005R.male, YOB=1910)
#'
#' @exportMethod ageShift
setGeneric("ageShift", function(object, YOB=1975, ...) standardGeneric("ageShift"));
#' @describeIn ageShift Age shifts apply only to mortalityTagle.ageShift, so
#' all other tables return NA.
setMethod("ageShift", "mortalityTable", function(object, YOB, ...) {
NA
})
#' @describeIn ageShift Return the age shift of the age-shifted life table
#' given the birth year
setMethod("ageShift",
......
......@@ -3,11 +3,14 @@
\docType{methods}
\name{ageShift}
\alias{ageShift}
\alias{ageShift,mortalityTable-method}
\alias{ageShift,mortalityTable.ageShift-method}
\title{Return the age shift of the age-shifted life table given the birth year}
\usage{
ageShift(object, YOB = 1975, ...)
\S4method{ageShift}{mortalityTable}(object, YOB = 1975, ...)
\S4method{ageShift}{mortalityTable.ageShift}(object, YOB = 1975, ...)
}
\arguments{
......@@ -22,6 +25,9 @@ Return the age shift of the age-shifted life table given the birth year
}
\section{Methods (by class)}{
\itemize{
\item \code{mortalityTable}: Age shifts apply only to mortalityTagle.ageShift, so
all other tables return NA.
\item \code{mortalityTable.ageShift}: Return the age shift of the age-shifted life table
given the birth year
}}
......@@ -31,5 +37,7 @@ mortalityTables.load("Austria_Annuities")
ageShift(AVOe2005R.male.av, YOB=1910)
ageShift(AVOe2005R.male.av, YOB=1955)
ageShift(AVOe2005R.male.av, YOB=2010)
# A table with trend does NOT have any age shift, so NA is returned:
ageShift(AVOe2005R.male, YOB=1910)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment