Commit 594677f2 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer

Make package check happy

- Document pensionTAble in readme
- remove wildcard reference
- Remove non-ascii characters
- Break long lines
- document undocumented function parameters
parent 29e4e00a
......@@ -11,7 +11,8 @@ NULL
#'
#' @examples
#' mortalityTables.load("Austria_Annuities")
#' # AVOe 2005R includes a trend decline by default, compare the exact table with the table without decline:
#' # AVOe 2005R includes a trend decline by default, compare the exact table
#' # with the table without decline:
#' mortalityImprovement(AVOe2005R.male, Period = 2017)
#' mortalityImprovement(AVOe2005R.male.nodamping, Period = 2017)
#'
......
......@@ -13,14 +13,14 @@ NULL
#'
#' @examples
#' mortalityTables.load("Austria_Annuities_AVOe2005R")
#' # AVÖ 2005R base table with yearly improvements of 3% for age 0, linearly
#' # AVOe 2005R base table with yearly improvements of 3% for age 0, linearly
#' # decreasing to 0% for age 120.
#' tb = mortalityTable.improvementFactors(
#' ages = ages(AVOe2005R.male),
#' deathProbs = periodDeathProbabilities(AVOe2005R.male, Period = 2002),
#' baseYear = 2002,
#' improvement = 0.03 * (1 - ages(AVOe2005R.male)/121),
#' name = "AVÖ 2005R base with linearly falling improvements (DEMO)"
#' name = "AVOe 2005R base with linearly falling improvements (DEMO)"
#' )
#' # Yearly trend is declining:
#' plotMortalityTrend(tb, AVOe2005R.male, Period = 2017, title = "Mortality Trend")
......
......@@ -21,7 +21,7 @@ NULL
#' AVOe2005R.myUnisex = mortalityTable.mixed(
#' table1 = AVOe2005R.male, table2 = AVOe2005R.female,
#' weight1 = 0.6, weight2 = 0.4,
#' name = "My custom AVÖ 2005R unisex (60:40)")
#' name = "My custom AVOe 2005R unisex (60:40)")
#' plot(AVOe2005R.myUnisex, AVOe2005R.male, AVOe2005R.female, Period = 2017)
#' @export mortalityTable.mixed
#' @exportClass mortalityTable.mixed
......
......@@ -89,9 +89,10 @@ pensionTableProbArrange = function(x, q, i, qi, r, ap, api, qp, h, qw, yx, qg, a
#' @param object A pension table object (instance of a \code{\linkS4class{pensionTable}} class)
#' @param ... Currently unused
#' @param YOB Year of birth
#' @param as.data.frame Whether the return value should be a data.frame or an array containing transition matrices
#'
#' @examples
#' pensionTables.load("Austria_*", wildcard=TRUE)
#' pensionTables.load("Austria_*")
#' # transitionProbabilities(EttlPagler.male)
#'
#' @exportMethod transitionProbabilities
......@@ -124,7 +125,7 @@ setMethod("transitionProbabilities", "pensionTable",
#' @param as.data.frame Whether the return value should be a data.frame or an array containing transition matrices
#'
#' @examples
#' pensionTables.load("Austria_*", wildcard=TRUE)
#' pensionTables.load("Austria_*")
#' # periodTransitionProbabilities(EttlPagler.male, Period = 2017)
#'
#' @exportMethod periodTransitionProbabilities
......
......@@ -48,6 +48,11 @@ Provided types of mortality tables are:
* Cohort life table using age-specific improvement factors
: Class `mortalityTable.improvementFactors`
: Project base life table using age-specific improvement factors.
* Pension table
: Class `pensionTable`
: Four states: active, early retirement / invalidity, old-age pension, death (with optional widow)
: All slots describe the corresponding transition probabilities by a
: `mortalityTable`-derived object.
## Loading the MortalityTables package
```
......@@ -61,7 +66,7 @@ and actuarial associations around the world. You can use the function
`mortalityTables.list` to list all available datasets (if no argument is given)
or all datasets that match the given pattern (wildcard character is *). You can
then use `mortalityTables.load` to load either one single data set or all
datasets that match the pattern (if `wildcard=TRUE` is given).
datasets that match the pattern.
```
# list all available data sets
......@@ -74,8 +79,8 @@ mortalityTables.list("Austria_*")
mortalityTables.load("Germany_Annuities_DAV2004R")
# Load all Austrian data sets
mortalityTables.load("Austria_*", wildcard=TRUE)
mortalityTables.load("Austria_*")
```
## Further information
For further information on how to use the package, see the "Using the MortalityTables Package" vignette.
\ No newline at end of file
For further information on how to use the package, see the "Using the MortalityTables Package" vignette.
......@@ -32,7 +32,8 @@ life table given the birth or observation year
\examples{
mortalityTables.load("Austria_Annuities")
# AVOe 2005R includes a trend decline by default, compare the exact table with the table without decline:
# AVOe 2005R includes a trend decline by default, compare the exact table
# with the table without decline:
mortalityImprovement(AVOe2005R.male, Period = 2017)
mortalityImprovement(AVOe2005R.male.nodamping, Period = 2017)
......
......@@ -21,14 +21,14 @@ describes the death probabilities in this year)}
\examples{
mortalityTables.load("Austria_Annuities_AVOe2005R")
# AVÖ 2005R base table with yearly improvements of 3\% for age 0, linearly
# AVOe 2005R base table with yearly improvements of 3\% for age 0, linearly
# decreasing to 0\% for age 120.
tb = mortalityTable.improvementFactors(
ages = ages(AVOe2005R.male),
deathProbs = periodDeathProbabilities(AVOe2005R.male, Period = 2002),
baseYear = 2002,
improvement = 0.03 * (1 - ages(AVOe2005R.male)/121),
name = "AVÖ 2005R base with linearly falling improvements (DEMO)"
name = "AVOe 2005R base with linearly falling improvements (DEMO)"
)
# Yearly trend is declining:
plotMortalityTrend(tb, AVOe2005R.male, Period = 2017, title = "Mortality Trend")
......
......@@ -32,6 +32,6 @@ mortalityTables.load("Austria_Annuities_AVOe2005R")
AVOe2005R.myUnisex = mortalityTable.mixed(
table1 = AVOe2005R.male, table2 = AVOe2005R.female,
weight1 = 0.6, weight2 = 0.4,
name = "My custom AVÖ 2005R unisex (60:40)")
name = "My custom AVOe 2005R unisex (60:40)")
plot(AVOe2005R.myUnisex, AVOe2005R.male, AVOe2005R.female, Period = 2017)
}
......@@ -29,7 +29,7 @@ Return all period transition probabilities of the pension table
}}
\examples{
pensionTables.load("Austria_*", wildcard=TRUE)
pensionTables.load("Austria_*")
# periodTransitionProbabilities(EttlPagler.male, Period = 2017)
}
......@@ -17,6 +17,8 @@ transitionProbabilities(object, ...)
\item{...}{Currently unused}
\item{YOB}{Year of birth}
\item{as.data.frame}{Whether the return value should be a data.frame or an array containing transition matrices}
}
\description{
Return all transition probabilities of the pension table (generational probabilities)
......@@ -27,7 +29,7 @@ Return all transition probabilities of the pension table (generational probabili
}}
\examples{
pensionTables.load("Austria_*", wildcard=TRUE)
pensionTables.load("Austria_*")
# transitionProbabilities(EttlPagler.male)
}
......@@ -78,7 +78,7 @@ and actuarial associations around the world. You can use the function
`mortalityTables.list` to list all available datasets (if no argument is given)
or all datasets that match the given pattern (wildcard character is *). You can
then use `mortalityTables.load` to load either one single data set or all
datasets that match the pattern (if `wildcard=TRUE` is given).
datasets that match the pattern.
```{r}
# list all available data sets
......
......@@ -12,7 +12,7 @@
<meta name="author" content="Reinhold Kainhofer, reinhold@kainhofer.com" />
<meta name="date" content="2017-09-09" />
<meta name="date" content="2017-09-11" />
<title>Using the MortalityTables Package</title>
......@@ -70,7 +70,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
<h1 class="title toc-ignore">Using the MortalityTables Package</h1>
<h4 class="author"><em>Reinhold Kainhofer, <a href="mailto:reinhold@kainhofer.com">reinhold@kainhofer.com</a></em></h4>
<h4 class="date"><em>2017-09-09</em></h4>
<h4 class="date"><em>2017-09-11</em></h4>
<div id="TOC">
......@@ -159,7 +159,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
</div>
<div id="provided-data-sets" class="section level2">
<h2>Provided Data Sets</h2>
<p>The package provides several real-life life tables published by census bureaus and actuarial associations around the world. You can use the function <code>mortalityTables.list</code> to list all available datasets (if no argument is given) or all datasets that match the given pattern (wildcard character is *). You can then use <code>mortalityTables.load</code> to load either one single data set or all datasets that match the pattern (if <code>wildcard=TRUE</code> is given).</p>
<p>The package provides several real-life life tables published by census bureaus and actuarial associations around the world. You can use the function <code>mortalityTables.list</code> to list all available datasets (if no argument is given) or all datasets that match the given pattern (wildcard character is *). You can then use <code>mortalityTables.load</code> to load either one single data set or all datasets that match the pattern.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># list all available data sets</span>
<span class="kw">mortalityTables.list</span>()
<span class="co">#&gt; [1] &quot;Austria_Annuities&quot; </span>
......
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