Description Usage Arguments Examples
View source: R/plotMortalityTrend.R
plotMortalityTrend
prints the trends of multiple life tables (objects
of child classes of mortalityTable
) in one plot, with a legend showing
the names of the tables.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
data |
First life table to be plotted. Either a |
... |
Additional life tables to be plotted (if |
aes |
Optional aesthetics to append or override the default. The default aesthetics will always be applied first and provide defaults for x, y and color. This argument can be used to override the defaults or append other aesthetics. |
ages |
Plot only the given ages |
xlim |
X-axis limitatation (as a two-element vector) |
ylim |
Y-axis limitatation (as a two-element vector) |
xlab |
X-axis label (default: "Alter") |
ylab |
Y-axis label (default: "Sterbewahrscheinlichkeit q_x relativ zu ....") |
title |
The plot title |
legend.position |
The position of the legend (default is |
legend.justification |
The justification of the legend (default is |
legend.title |
Title of the legend ( |
legend.key.width |
The keywith of the lines in the legend (default is |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Load the Austrian aunnity data
mortalityTables.load("Austria_Annuities")
# Compare the trends of these tables
plotMortalityTrend(AVOe2005R.male, AVOe2005R.female, AVOe1996R.male, AVOe1996R.female,
Period = 2002, title = "Trends of Austrian Annuity Tables")
# For tables with a non-constant trend, the Period and YOB can be used to compare
# the age-specific trends that apply to the death probabilities during a given
# period or for a given birth year
plotMortalityTrend(AVOe2005R.male, AVOe2005R.female, AVOe1996R.male, AVOe1996R.female,
YOB = 1950, title = "Trends of Austrian Annuity Tables for cohort YOB=1950")
plotMortalityTrend(AVOe2005R.male, AVOe2005R.female, AVOe1996R.male, AVOe1996R.female,
YOB = 2000, title = "Trends of Austrian Annuity Tables for cohort YOB=2000")
plotMortalityTrend(AVOe2005R.male, AVOe2005R.female, AVOe1996R.male, AVOe1996R.female,
Period = 1999, title = "Trends of Austrian Annuity Tables for Period 2002")
plotMortalityTrend(AVOe2005R.male, AVOe2005R.female, AVOe1996R.male, AVOe1996R.female,
Period = 2030, title = "Trends of Austrian Annuity Tables for Period 2030")
#' @import scales
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.