Commit f573eea5 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer

plotMortalityTableComparison / plotMortalityTrend: Add legend.title argument (and document it...)

parent 889d62ea
...@@ -12,8 +12,10 @@ ...@@ -12,8 +12,10 @@
#' @param ylab Y-axis label (default: "Sterbewahrscheinlichkeit q_x relativ zu ....") #' @param ylab Y-axis label (default: "Sterbewahrscheinlichkeit q_x relativ zu ....")
#' @param title The plot title #' @param title The plot title
#' @param legend.position The position of the legend (default is \code{c(0.9,0.1)}) #' @param legend.position The position of the legend (default is \code{c(0.9,0.1)})
#' @param legend.justification The justification of the legend (default is \code{c(1,)})
#' @param legend.key.width The keywith of the lines in the legend (default is \code{unit(25,"mm")}) #' @param legend.key.width The keywith of the lines in the legend (default is \code{unit(25,"mm")})
#' @param legend.title Title of the legend (\code{NULL} to hide) #' @param legend.title Title of the legend (\code{NULL} to hide)
#' @param ages Plot only the given ages
#' #'
#' @examples #' @examples
#' # Load the Austrian aunnity data #' # Load the Austrian aunnity data
......
...@@ -23,5 +23,9 @@ to give the user a way to modify the final probabilities} ...@@ -23,5 +23,9 @@ to give the user a way to modify the final probabilities}
\item{\code{loading}}{Additional security loading on the resulting table (single numeric \item{\code{loading}}{Additional security loading on the resulting table (single numeric
value, e.g. 0.05 adds 5\% security margin to the probabilities)} value, e.g. 0.05 adds 5\% security margin to the probabilities)}
\item{\code{data}}{Placeholder list to make it possible to store any kind of data
associated with the object inside the object (e.g. the underlying
data used to derive the death probabilities, parameters for adjustment, etc.)}
}} }}
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
plotMortalityTableComparisons(data, ..., ages = NULL, xlim = NULL, plotMortalityTableComparisons(data, ..., ages = NULL, xlim = NULL,
ylim = NULL, xlab = NULL, ylab = NULL, title = "", ylim = NULL, xlab = NULL, ylab = NULL, title = "",
legend.position = c(0.9, 0.1), legend.justification = c(1, 0), legend.position = c(0.9, 0.1), legend.justification = c(1, 0),
legend.key.width = unit(25, "mm"), reference = NULL) legend.title = "Sterbetafel", legend.key.width = unit(25, "mm"),
reference = NULL)
} }
\arguments{ \arguments{
\item{data}{First life table to be plotted. Either a \code{data.frame} generated by \code{makeQxDataFrame} or a \code{mortalityTable} object} \item{data}{First life table to be plotted. Either a \code{data.frame} generated by \code{makeQxDataFrame} or a \code{mortalityTable} object}
...@@ -30,6 +31,8 @@ plotMortalityTableComparisons(data, ..., ages = NULL, xlim = NULL, ...@@ -30,6 +31,8 @@ plotMortalityTableComparisons(data, ..., ages = NULL, xlim = NULL,
\item{legend.justification}{The justification of the legend (default is \code{c(1,)})} \item{legend.justification}{The justification of the legend (default is \code{c(1,)})}
\item{legend.title}{Title of the legend (\code{NULL} to hide)}
\item{legend.key.width}{The keywith of the lines in the legend (default is \code{unit(25,"mm")})} \item{legend.key.width}{The keywith of the lines in the legend (default is \code{unit(25,"mm")})}
\item{reference}{The reference table that determines the 100\% values. If not given, the first argument of \code{data} is used as reference table.} \item{reference}{The reference table that determines the 100\% values. If not given, the first argument of \code{data} is used as reference table.}
......
...@@ -16,7 +16,7 @@ plotMortalityTables(data, ..., ages = NULL, legend.title = "Sterbetafel", ...@@ -16,7 +16,7 @@ plotMortalityTables(data, ..., ages = NULL, legend.title = "Sterbetafel",
\item{ages}{Plot only the given ages} \item{ages}{Plot only the given ages}
\item{legend.title}{Title of the legend} \item{legend.title}{Title of the legend (\code{NULL} to hide)}
\item{xlim}{X-axis limitatation (as a two-element vector)} \item{xlim}{X-axis limitatation (as a two-element vector)}
......
...@@ -6,13 +6,16 @@ ...@@ -6,13 +6,16 @@
\usage{ \usage{
plotMortalityTrend(data, ..., ages = NULL, xlim = NULL, ylim = NULL, plotMortalityTrend(data, ..., ages = NULL, xlim = NULL, ylim = NULL,
xlab = NULL, ylab = NULL, title = "", legend.position = c(0.9, 0.9), xlab = NULL, ylab = NULL, title = "", legend.position = c(0.9, 0.9),
legend.justification = c(1, 1), legend.key.width = unit(25, "mm")) legend.justification = c(1, 1), legend.title = "Sterbetafel",
legend.key.width = unit(25, "mm"))
} }
\arguments{ \arguments{
\item{data}{First life table to be plotted. Either a \code{data.frame} generated by \code{makeQxDataFrame} or a \code{mortalityTable} object} \item{data}{First life table to be plotted. Either a \code{data.frame} generated by \code{makeQxDataFrame} or a \code{mortalityTable} object}
\item{...}{Additional life tables to be plotted (if \code{data} is a \code{mortalityTable} object)} \item{...}{Additional life tables to be plotted (if \code{data} is a \code{mortalityTable} object)}
\item{ages}{Plot only the given ages}
\item{xlim}{X-axis limitatation (as a two-element vector)} \item{xlim}{X-axis limitatation (as a two-element vector)}
\item{ylim}{Y-axis limitatation (as a two-element vector)} \item{ylim}{Y-axis limitatation (as a two-element vector)}
...@@ -25,6 +28,10 @@ plotMortalityTrend(data, ..., ages = NULL, xlim = NULL, ylim = NULL, ...@@ -25,6 +28,10 @@ plotMortalityTrend(data, ..., ages = NULL, xlim = NULL, ylim = NULL,
\item{legend.position}{The position of the legend (default is \code{c(0.9,0.1)})} \item{legend.position}{The position of the legend (default is \code{c(0.9,0.1)})}
\item{legend.justification}{The justification of the legend (default is \code{c(1,)})}
\item{legend.title}{Title of the legend (\code{NULL} to hide)}
\item{legend.key.width}{The keywith of the lines in the legend (default is \code{unit(25,"mm")})} \item{legend.key.width}{The keywith of the lines in the legend (default is \code{unit(25,"mm")})}
} }
\description{ \description{
......
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