From 3a34c4ca57f0edbb4bbdedb7104122115ec41d7e Mon Sep 17 00:00:00 2001
From: Reinhold Kainhofer <reinhold@kainhofer.com>
Date: Thu, 13 Oct 2016 15:02:08 +0000
Subject: [PATCH] Add examples to many functions

---
 man/ageShift.Rd             | 7 +++++++
 man/ages.Rd                 | 7 +++++++
 man/baseTable.Rd            | 5 +++++
 man/baseYear.Rd             | 5 +++++
 man/mortalityTables.list.Rd | 5 ++++-
 man/mortalityTables.load.Rd | 5 ++++-
 6 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/man/ageShift.Rd b/man/ageShift.Rd
index 7110cf5..ddaed95 100644
--- a/man/ageShift.Rd
+++ b/man/ageShift.Rd
@@ -25,4 +25,11 @@ Return the age shift of the age-shifted life table given the birth year
 \item \code{mortalityTable.ageShift}: Return the age shift of the age-shifted life table
 given the birth year
 }}
+\examples{
+mortalityTables.load("Austria_Annuities")
+ageShift(AVOe2005R.male.av, YOB=1910)
+ageShift(AVOe2005R.male.av, YOB=1955)
+ageShift(AVOe2005R.male.av, YOB=2010)
+
+}
 
diff --git a/man/ages.Rd b/man/ages.Rd
index 49cccf3..9c147c6 100644
--- a/man/ages.Rd
+++ b/man/ages.Rd
@@ -37,4 +37,11 @@ Return the defined ages of the life table
 
 \item \code{mortalityTable.observed}: Return the defined ages of the observed life table
 }}
+\examples{
+mortalityTables.load("Austria_*", wildcard=TRUE)
+ages(AVOe2005R.male)
+ages(AVOe1996R.male)
+ages(mort.AT.census.2011.male)
+
+}
 
diff --git a/man/baseTable.Rd b/man/baseTable.Rd
index 7011174..4b7dd34 100644
--- a/man/baseTable.Rd
+++ b/man/baseTable.Rd
@@ -27,4 +27,9 @@ Return the base table of the life table
 
 \item \code{mortalityTable.period}: Return the base table of the life table
 }}
+\examples{
+mortalityTables.load("Austria_Annuities")
+baseTable(AVOe2005R.male)
+
+}
 
diff --git a/man/baseYear.Rd b/man/baseYear.Rd
index 059a6ce..281ff4b 100644
--- a/man/baseYear.Rd
+++ b/man/baseYear.Rd
@@ -27,4 +27,9 @@ Return the base year of the life table
 
 \item \code{mortalityTable.mixed}: Return the base year of the life table
 }}
+\examples{
+mortalityTables.load("Austria_Annuities")
+baseYear(AVOe2005R.male)
+
+}
 
diff --git a/man/mortalityTables.list.Rd b/man/mortalityTables.list.Rd
index 773165c..a8c18d8 100644
--- a/man/mortalityTables.list.Rd
+++ b/man/mortalityTables.list.Rd
@@ -5,10 +5,13 @@
 \title{List all available sets of life tables provided by the \link[MortalityTables]{MortalityTables-package} package
 An existing life table can then be loaded with \link{mortalityTables.load}.}
 \usage{
-mortalityTables.list(pattern = "*")
+mortalityTables.list(pattern = "*", package = "MortalityTables")
 }
 \arguments{
 \item{pattern}{Restrict the results only to life table sets that match the pattern (default: "*" to show all sets)}
+
+\item{package}{The package that contains the desired dataset in its \code{extdata/}
+directory. Defaults to the "MortalityTables" package.}
 }
 \description{
 List all available sets of life tables provided by the \link[MortalityTables]{MortalityTables-package} package
diff --git a/man/mortalityTables.load.Rd b/man/mortalityTables.load.Rd
index 3117708..26b13d8 100644
--- a/man/mortalityTables.load.Rd
+++ b/man/mortalityTables.load.Rd
@@ -4,7 +4,7 @@
 \alias{mortalityTables.load}
 \title{Load a named set of mortality tables provided by the \link{MortalityTables} package}
 \usage{
-mortalityTables.load(dataset, wildcard = FALSE)
+mortalityTables.load(dataset, wildcard = FALSE, package = "MortalityTables")
 }
 \arguments{
 \item{dataset}{The set of life tables to be loaded. A list of all available
@@ -12,6 +12,9 @@ data sets is provided by the function \code{\link{mortalityTables.list}}.}
 
 \item{wildcard}{Whether the dataset name contains wildcard. If TRUE, all
 datasets matching the pattern will be loaded}
+
+\item{package}{The package that contains the dataset in its \code{extdata/}
+directory. Defaults to the "MortalityTables" package.}
 }
 \description{
 Load a named set of mortality tables provided by the \link{MortalityTables} package
-- 
GitLab