Commit 5073a605 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 ...@@ -11,7 +11,8 @@ NULL
#' #'
#' @examples #' @examples
#' mortalityTables.load("Austria_Annuities") #' 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, Period = 2017)
#' mortalityImprovement(AVOe2005R.male.nodamping, Period = 2017) #' mortalityImprovement(AVOe2005R.male.nodamping, Period = 2017)
#' #'
......
...@@ -13,7 +13,7 @@ NULL ...@@ -13,7 +13,7 @@ NULL
#' #'
#' @examples #' @examples
#' mortalityTables.load("Austria_Annuities_AVOe2005R") #' 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. #' # decreasing to 0% for age 120.
#' tb = mortalityTable.improvementFactors( #' tb = mortalityTable.improvementFactors(
#' ages = ages(AVOe2005R.male), #' ages = ages(AVOe2005R.male),
......
...@@ -21,7 +21,7 @@ NULL ...@@ -21,7 +21,7 @@ NULL
#' AVOe2005R.myUnisex = mortalityTable.mixed( #' AVOe2005R.myUnisex = mortalityTable.mixed(
#' table1 = AVOe2005R.male, table2 = AVOe2005R.female, #' table1 = AVOe2005R.male, table2 = AVOe2005R.female,
#' weight1 = 0.6, weight2 = 0.4, #' 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) #' plot(AVOe2005R.myUnisex, AVOe2005R.male, AVOe2005R.female, Period = 2017)
#' @export mortalityTable.mixed #' @export mortalityTable.mixed
#' @exportClass mortalityTable.mixed #' @exportClass mortalityTable.mixed
......
...@@ -89,9 +89,10 @@ pensionTableProbArrange = function(x, q, i, qi, r, ap, api, qp, h, qw, yx, qg, a ...@@ -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 object A pension table object (instance of a \code{\linkS4class{pensionTable}} class)
#' @param ... Currently unused #' @param ... Currently unused
#' @param YOB Year of birth #' @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 #' @examples
#' pensionTables.load("Austria_*", wildcard=TRUE) #' pensionTables.load("Austria_*")
#' # transitionProbabilities(EttlPagler.male) #' # transitionProbabilities(EttlPagler.male)
#' #'
#' @exportMethod transitionProbabilities #' @exportMethod transitionProbabilities
...@@ -124,7 +125,7 @@ setMethod("transitionProbabilities", "pensionTable", ...@@ -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 #' @param as.data.frame Whether the return value should be a data.frame or an array containing transition matrices
#' #'
#' @examples #' @examples
#' pensionTables.load("Austria_*", wildcard=TRUE) #' pensionTables.load("Austria_*")
#' # periodTransitionProbabilities(EttlPagler.male, Period = 2017) #' # periodTransitionProbabilities(EttlPagler.male, Period = 2017)
#' #'
#' @exportMethod periodTransitionProbabilities #' @exportMethod periodTransitionProbabilities
......
...@@ -48,6 +48,11 @@ Provided types of mortality tables are: ...@@ -48,6 +48,11 @@ Provided types of mortality tables are:
* Cohort life table using age-specific improvement factors * Cohort life table using age-specific improvement factors
: Class `mortalityTable.improvementFactors` : Class `mortalityTable.improvementFactors`
: Project base life table using age-specific improvement factors. : 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 ## Loading the MortalityTables package
``` ```
...@@ -61,7 +66,7 @@ and actuarial associations around the world. You can use the function ...@@ -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) `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 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 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 # list all available data sets
...@@ -74,8 +79,8 @@ mortalityTables.list("Austria_*") ...@@ -74,8 +79,8 @@ mortalityTables.list("Austria_*")
mortalityTables.load("Germany_Annuities_DAV2004R") mortalityTables.load("Germany_Annuities_DAV2004R")
# Load all Austrian data sets # Load all Austrian data sets
mortalityTables.load("Austria_*", wildcard=TRUE) mortalityTables.load("Austria_*")
``` ```
## Further information ## Further information
For further information on how to use the package, see the "Using the MortalityTables Package" vignette. For further information on how to use the package, see the "Using the MortalityTables Package" vignette.
\ No newline at end of file
...@@ -32,7 +32,8 @@ life table given the birth or observation year ...@@ -32,7 +32,8 @@ life table given the birth or observation year
\examples{ \examples{
mortalityTables.load("Austria_Annuities") 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, Period = 2017)
mortalityImprovement(AVOe2005R.male.nodamping, Period = 2017) mortalityImprovement(AVOe2005R.male.nodamping, Period = 2017)
......
...@@ -21,7 +21,7 @@ describes the death probabilities in this year)} ...@@ -21,7 +21,7 @@ describes the death probabilities in this year)}
\examples{ \examples{
mortalityTables.load("Austria_Annuities_AVOe2005R") 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. # decreasing to 0\% for age 120.
tb = mortalityTable.improvementFactors( tb = mortalityTable.improvementFactors(
ages = ages(AVOe2005R.male), ages = ages(AVOe2005R.male),
......
...@@ -32,6 +32,6 @@ mortalityTables.load("Austria_Annuities_AVOe2005R") ...@@ -32,6 +32,6 @@ mortalityTables.load("Austria_Annuities_AVOe2005R")
AVOe2005R.myUnisex = mortalityTable.mixed( AVOe2005R.myUnisex = mortalityTable.mixed(
table1 = AVOe2005R.male, table2 = AVOe2005R.female, table1 = AVOe2005R.male, table2 = AVOe2005R.female,
weight1 = 0.6, weight2 = 0.4, 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) plot(AVOe2005R.myUnisex, AVOe2005R.male, AVOe2005R.female, Period = 2017)
} }
...@@ -29,7 +29,7 @@ Return all period transition probabilities of the pension table ...@@ -29,7 +29,7 @@ Return all period transition probabilities of the pension table
}} }}
\examples{ \examples{
pensionTables.load("Austria_*", wildcard=TRUE) pensionTables.load("Austria_*")
# periodTransitionProbabilities(EttlPagler.male, Period = 2017) # periodTransitionProbabilities(EttlPagler.male, Period = 2017)
} }
...@@ -17,6 +17,8 @@ transitionProbabilities(object, ...) ...@@ -17,6 +17,8 @@ transitionProbabilities(object, ...)
\item{...}{Currently unused} \item{...}{Currently unused}
\item{YOB}{Year of birth} \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{ \description{
Return all transition probabilities of the pension table (generational probabilities) Return all transition probabilities of the pension table (generational probabilities)
...@@ -27,7 +29,7 @@ Return all transition probabilities of the pension table (generational probabili ...@@ -27,7 +29,7 @@ Return all transition probabilities of the pension table (generational probabili
}} }}
\examples{ \examples{
pensionTables.load("Austria_*", wildcard=TRUE) pensionTables.load("Austria_*")
# transitionProbabilities(EttlPagler.male) # transitionProbabilities(EttlPagler.male)
} }
...@@ -78,7 +78,7 @@ and actuarial associations around the world. You can use the function ...@@ -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) `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 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 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} ```{r}
# list all available data sets # list all available data sets
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<meta name="author" content="Reinhold Kainhofer, reinhold@kainhofer.com" /> <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> <title>Using the MortalityTables Package</title>
...@@ -70,7 +70,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf ...@@ -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> <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="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"> <div id="TOC">
...@@ -159,7 +159,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf ...@@ -159,7 +159,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
</div> </div>
<div id="provided-data-sets" class="section level2"> <div id="provided-data-sets" class="section level2">
<h2>Provided Data Sets</h2> <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> <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="kw">mortalityTables.list</span>()
<span class="co">#&gt; [1] &quot;Austria_Annuities&quot; </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