Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
R - Mortality Tables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
R
R - Mortality Tables
Commits
8a701e19
Commit
8a701e19
authored
7 years ago
by
Reinhold Kainhofer
Browse files
Options
Downloads
Patches
Plain Diff
Make package check happy (typos etc.)
parent
799385ff
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/mortalityTable.improvementFactors.R
+5
-5
5 additions, 5 deletions
R/mortalityTable.improvementFactors.R
man/calculateImprovements.Rd
+4
-4
4 additions, 4 deletions
man/calculateImprovements.Rd
with
9 additions
and
9 deletions
R/mortalityTable.improvementFactors.R
+
5
−
5
View file @
8a701e19
...
@@ -47,7 +47,7 @@ mortalityTable.improvementFactors = setClass(
...
@@ -47,7 +47,7 @@ mortalityTable.improvementFactors = setClass(
#' Calculate the improvement factors for the given birth-year and the
#' Calculate the improvement factors for the given birth-year and the
#' \code{\linkS4class{mortalityTable.improvement
s
Factors}} object
#' \code{\linkS4class{mortalityTable.improvementFactors}} object
#'
#'
#' @param object A pension table object (instance of a \code{\linkS4class{mortalityTable.improvementFactors}} class)
#' @param object A pension table object (instance of a \code{\linkS4class{mortalityTable.improvementFactors}} class)
#' @param ... Currently unused
#' @param ... Currently unused
...
@@ -56,21 +56,21 @@ mortalityTable.improvementFactors = setClass(
...
@@ -56,21 +56,21 @@ mortalityTable.improvementFactors = setClass(
#'
#'
#' @examples
#' @examples
#' pensionTables.load("USA_PensionPlan_RP2014")
#' pensionTables.load("USA_PensionPlan_RP2014")
#' calculateImprovements(RP2014.male, YOB = 2017)
#' calculateImprovements(RP2014.male
@qx
, YOB = 2017)
#'
#'
#' @exportMethod calculateImprovements
#' @exportMethod calculateImprovements
setGeneric
(
"calculateImprovements"
,
function
(
object
,
...
)
standardGeneric
(
"calculateImprovements"
));
setGeneric
(
"calculateImprovements"
,
function
(
object
,
...
)
standardGeneric
(
"calculateImprovements"
));
#' @describeIn calculateImprovements Calculate the total mortality improvement
#' @describeIn calculateImprovements Calculate the total mortality improvement
#' factors relative to the base year for the given birth-year and the
#' factors relative to the base year for the given birth-year and the
#' \code{\linkS4class{mortalityTable.improvement
s
Factors}} object
#' \code{\linkS4class{mortalityTable.improvementFactors}} object
setMethod
(
"calculateImprovements"
,
"mortalityTable.improvementFactors"
,
setMethod
(
"calculateImprovements"
,
"mortalityTable.improvementFactors"
,
function
(
object
,
...
,
Period
=
NULL
,
YOB
=
1982
)
{
function
(
object
,
...
,
Period
=
NULL
,
YOB
=
1982
)
{
if
(
is.array
(
object
@
improvement
))
{
if
(
is.array
(
object
@
improvement
))
{
# All years outside the observation interval use the improvements
# All years outside the observation interval use the improvements
# at the boundaries
# at the boundaries
minObservation
=
strtoi
(
head
(
colnames
(
object
@
improvement
),
1
))
minObservation
=
strtoi
(
utils
::
head
(
colnames
(
object
@
improvement
),
1
))
maxObservation
=
strtoi
(
tail
(
colnames
(
object
@
improvement
),
1
))
maxObservation
=
strtoi
(
utils
::
tail
(
colnames
(
object
@
improvement
),
1
))
if
(
!
missing
(
Period
)
&&
!
is.null
(
Period
))
{
if
(
!
missing
(
Period
)
&&
!
is.null
(
Period
))
{
# Period improvements:
# Period improvements:
...
...
This diff is collapsed.
Click to expand it.
man/calculateImprovements.Rd
+
4
−
4
View file @
8a701e19
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
\alias{calculateImprovements}
\alias{calculateImprovements}
\alias{calculateImprovements,mortalityTable.improvementFactors-method}
\alias{calculateImprovements,mortalityTable.improvementFactors-method}
\title{Calculate the improvement factors for the given birth-year and the
\title{Calculate the improvement factors for the given birth-year and the
\code{\linkS4class{mortalityTable.improvement
s
Factors}} object}
\code{\linkS4class{mortalityTable.improvementFactors}} object}
\usage{
\usage{
calculateImprovements(object, ...)
calculateImprovements(object, ...)
...
@@ -23,17 +23,17 @@ calculateImprovements(object, ...)
...
@@ -23,17 +23,17 @@ calculateImprovements(object, ...)
}
}
\description{
\description{
Calculate the improvement factors for the given birth-year and the
Calculate the improvement factors for the given birth-year and the
\code{\linkS4class{mortalityTable.improvement
s
Factors}} object
\code{\linkS4class{mortalityTable.improvementFactors}} object
}
}
\section{Methods (by class)}{
\section{Methods (by class)}{
\itemize{
\itemize{
\item \code{mortalityTable.improvementFactors}: Calculate the total mortality improvement
\item \code{mortalityTable.improvementFactors}: Calculate the total mortality improvement
factors relative to the base year for the given birth-year and the
factors relative to the base year for the given birth-year and the
\code{\linkS4class{mortalityTable.improvement
s
Factors}} object
\code{\linkS4class{mortalityTable.improvementFactors}} object
}}
}}
\examples{
\examples{
pensionTables.load("USA_PensionPlan_RP2014")
pensionTables.load("USA_PensionPlan_RP2014")
calculateImprovements(RP2014.male, YOB = 2017)
calculateImprovements(RP2014.male
@qx
, YOB = 2017)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment