diff --git a/NAMESPACE b/NAMESPACE index d0d1c93ddc9aed28009185e4c7e92a51a3d6b697..47e542a6220db5d1b66c4a3f6dbeb8bde48666c9 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -39,3 +39,4 @@ exportMethods(undampenTrend) import(ggplot2) import(methods) import(scales) +import(stats) diff --git a/R/mortalityComparisonTable.R b/R/mortalityComparisonTable.R index 92731a3ce82981198a01ee796a1bf9c80e052457..15415a035aeae810c4229cb8d29cc7e7ea14bf13 100644 --- a/R/mortalityComparisonTable.R +++ b/R/mortalityComparisonTable.R @@ -1,3 +1,5 @@ +#' @import stats +NULL ageRanges = function(ages, binsize = 5) { rangestart = floor(ages / binsize) * binsize @@ -10,14 +12,22 @@ ageRanges = function(ages, binsize = 5) { #' @param years Vector of birth years to include in the comparisons. #' @param ages Vector of ages to include in the comparisons #' @param binsize How many ages to combine into one age band +#' @param ... Other parameters (currently unused) #' #' @examples #' mortalityTables.load("Austria_Annuities") #' # Compare mortality of Austrian male and female annuitants born 1930 to 2030 -#' mortalityComparisonTable(AVOe2005R.male, AVOe2005R.female, years = seq(1930, 2030, by = 10), ages = 0:119) +#' mortalityComparisonTable( +#' AVOe2005R.male, AVOe2005R.female, +#' years = seq(1930, 2030, by = 10), +#' ages = 0:119) #' -#' # Compare the two Austrian male annuity tables AVÖ 2005-R and AVÖ 1996-R, combine ages 10-19, 20-29, etc. -#' mortalityComparisonTable(AVOe2005R.male, AVOe1996R.male, years = seq(1930, 2030, by = 10), ages = 0:109, binsize=10) +#' # Compare the two Austrian male annuity tables AVOe 2005-R and AVOe 1996-R, +#' # combining ages 10-19, 20-29, etc. +#' mortalityComparisonTable( +#' AVOe2005R.male, AVOe1996R.male, +#' years = seq(1930, 2030, by = 10), +#' ages = 0:109, binsize=10) #' #' #' @export diff --git a/man/mortalityComparisonTable.Rd b/man/mortalityComparisonTable.Rd index 202727506d08afb096b95451c934a7764f773026..1b9ae606d04d7b693d3bd0a679771336fe9b819c 100644 --- a/man/mortalityComparisonTable.Rd +++ b/man/mortalityComparisonTable.Rd @@ -14,6 +14,8 @@ mortalityComparisonTable(table1, table2, years, ages, binsize = 5, ...) \item{ages}{Vector of ages to include in the comparisons} \item{binsize}{How many ages to combine into one age band} + +\item{...}{Other parameters (currently unused)} } \description{ Calculate relative mortalities for age bands and birth years @@ -21,10 +23,17 @@ Calculate relative mortalities for age bands and birth years \examples{ mortalityTables.load("Austria_Annuities") # Compare mortality of Austrian male and female annuitants born 1930 to 2030 -mortalityComparisonTable(AVOe2005R.male, AVOe2005R.female, years = seq(1930, 2030, by = 10), ages = 0:119) +mortalityComparisonTable( + AVOe2005R.male, AVOe2005R.female, + years = seq(1930, 2030, by = 10), + ages = 0:119) -# Compare the two Austrian male annuity tables AVÖ 2005-R and AVÖ 1996-R, combine ages 10-19, 20-29, etc. -mortalityComparisonTable(AVOe2005R.male, AVOe1996R.male, years = seq(1930, 2030, by = 10), ages = 0:109, binsize=10) +# Compare the two Austrian male annuity tables AVOe 2005-R and AVOe 1996-R, +# combining ages 10-19, 20-29, etc. +mortalityComparisonTable( + AVOe2005R.male, AVOe1996R.male, + years = seq(1930, 2030, by = 10), + ages = 0:109, binsize=10) }