Skip to content
Snippets Groups Projects
Commit 3a34c4ca authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Add examples to many functions

parent 22161826
Branches
Tags
No related merge requests found
...@@ -25,4 +25,11 @@ Return the age shift of the age-shifted life table given the birth year ...@@ -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 \item \code{mortalityTable.ageShift}: Return the age shift of the age-shifted life table
given the birth year 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)
}
...@@ -37,4 +37,11 @@ Return the defined ages of the life table ...@@ -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 \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)
}
...@@ -27,4 +27,9 @@ Return the base table of the life table ...@@ -27,4 +27,9 @@ Return the base table of the life table
\item \code{mortalityTable.period}: 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)
}
...@@ -27,4 +27,9 @@ Return the base year of the life table ...@@ -27,4 +27,9 @@ Return the base year of the life table
\item \code{mortalityTable.mixed}: 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)
}
...@@ -5,10 +5,13 @@ ...@@ -5,10 +5,13 @@
\title{List all available sets of life tables provided by the \link[MortalityTables]{MortalityTables-package} package \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}.} An existing life table can then be loaded with \link{mortalityTables.load}.}
\usage{ \usage{
mortalityTables.list(pattern = "*") mortalityTables.list(pattern = "*", package = "MortalityTables")
} }
\arguments{ \arguments{
\item{pattern}{Restrict the results only to life table sets that match the pattern (default: "*" to show all sets)} \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{ \description{
List all available sets of life tables provided by the \link[MortalityTables]{MortalityTables-package} package List all available sets of life tables provided by the \link[MortalityTables]{MortalityTables-package} package
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
\alias{mortalityTables.load} \alias{mortalityTables.load}
\title{Load a named set of mortality tables provided by the \link{MortalityTables} package} \title{Load a named set of mortality tables provided by the \link{MortalityTables} package}
\usage{ \usage{
mortalityTables.load(dataset, wildcard = FALSE) mortalityTables.load(dataset, wildcard = FALSE, package = "MortalityTables")
} }
\arguments{ \arguments{
\item{dataset}{The set of life tables to be loaded. A list of all available \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}}.} ...@@ -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 \item{wildcard}{Whether the dataset name contains wildcard. If TRUE, all
datasets matching the pattern will be loaded} 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{ \description{
Load a named set of mortality tables provided by the \link{MortalityTables} package Load a named set of mortality tables provided by the \link{MortalityTables} package
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment