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

mt.setTrend: Allow setting the damping function, too

parent 3701b986
Branches
Tags
No related merge requests found
...@@ -119,14 +119,15 @@ mT.scaleProbs = function(table, factor = 1.0, name.postfix = "scaled", name = pa ...@@ -119,14 +119,15 @@ mT.scaleProbs = function(table, factor = 1.0, name.postfix = "scaled", name = pa
#' @export #' @export
mT.setTrend = function(table, trend, trendages = ages(table), baseYear = table@baseYear) { mT.setTrend = function(table, trend, trendages = ages(table), baseYear = table@baseYear, dampingFunction = identity) {
if (!is(table, "mortalityTable")) if (!is(table, "mortalityTable"))
stop("First argument must be a mortalityTable.") stop("First argument must be a mortalityTable.")
t = mortalityTable.trendProjection( t = mortalityTable.trendProjection(
table, table,
baseYear = baseYear, baseYear = baseYear,
trend = trend[match(table@ages, trendages)] trend = trend[match(table@ages, trendages)],
dampingFunction = dampingFunction
) )
t t
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment