diff --git a/R/ageShift.R b/R/ageShift.R index edefc8be97935267ed4206173ee28f31cc5c8c93..ec81c112933f2e125a0385688c0f126395e2274d 100644 --- a/R/ageShift.R +++ b/R/ageShift.R @@ -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", diff --git a/man/ageShift.Rd b/man/ageShift.Rd index 6692a38bc9743a913b17cad4dc94df551453e9b3..e1444066b95a7e101c7e12e8d72133c5b974ba11 100644 --- a/man/ageShift.Rd +++ b/man/ageShift.Rd @@ -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) }