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
b54cb929
Commit
b54cb929
authored
7 years ago
by
Reinhold Kainhofer
Browse files
Options
Downloads
Patches
Plain Diff
Add utility function mortalityTable.onceAndFuture
parent
a5b9c7ab
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NAMESPACE
+1
-0
1 addition, 0 deletions
NAMESPACE
R/mortalityTable.period.R
+14
-0
14 additions, 0 deletions
R/mortalityTable.period.R
man/mortalityTable.onceAndFuture.Rd
+19
-0
19 additions, 0 deletions
man/mortalityTable.onceAndFuture.Rd
with
34 additions
and
0 deletions
NAMESPACE
+
1
−
0
View file @
b54cb929
...
@@ -13,6 +13,7 @@ export(mortalityTable.jointLives)
...
@@ -13,6 +13,7 @@ export(mortalityTable.jointLives)
export(mortalityTable.mixed)
export(mortalityTable.mixed)
export(mortalityTable.observed)
export(mortalityTable.observed)
export(mortalityTable.once)
export(mortalityTable.once)
export(mortalityTable.onceAndFuture)
export(mortalityTable.period)
export(mortalityTable.period)
export(mortalityTable.trendProjection)
export(mortalityTable.trendProjection)
export(mortalityTable.zeroes)
export(mortalityTable.zeroes)
...
...
This diff is collapsed.
Click to expand it.
R/mortalityTable.period.R
+
14
−
0
View file @
b54cb929
...
@@ -49,3 +49,17 @@ mortalityTable.once = function(transitionAge, name = "Deterministic mortality ta
...
@@ -49,3 +49,17 @@ mortalityTable.once = function(transitionAge, name = "Deterministic mortality ta
)
)
}
}
#' Generate a (deterministic) mortality table with all probabilities starting at a given age set to 1
#'
#' @param transitionAge The age where the deterministic transition occurs
#' @param name The name of the table
#' @param ages The ages of the table
#'
#' @export
mortalityTable.onceAndFuture
=
function
(
transitionAge
,
name
=
"Deterministic mortality table"
,
ages
=
0
:
99
)
{
mortalityTable.period
(
name
=
name
,
ages
=
ages
,
deathProbs
=
sapply
(
ages
,
function
(
x
)
{
if
(
x
>=
transitionAge
)
1
else
0
})
)
}
This diff is collapsed.
Click to expand it.
man/mortalityTable.onceAndFuture.Rd
0 → 100644
+
19
−
0
View file @
b54cb929
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mortalityTable.period.R
\name{mortalityTable.onceAndFuture}
\alias{mortalityTable.onceAndFuture}
\title{Generate a (deterministic) mortality table with all probabilities starting at a given age set to 1}
\usage{
mortalityTable.onceAndFuture(transitionAge,
name = "Deterministic mortality table", ages = 0:99)
}
\arguments{
\item{transitionAge}{The age where the deterministic transition occurs}
\item{name}{The name of the table}
\item{ages}{The ages of the table}
}
\description{
Generate a (deterministic) mortality table with all probabilities starting at a given age set to 1
}
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