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

Add mT.setDimInfo function to set the dimensional infor for makeQxDataFrame

parent 775ff4df
Branches
Tags
No related merge requests found
...@@ -183,6 +183,9 @@ mT.extrapolateProbsExp = function(table, age, up = TRUE) { ...@@ -183,6 +183,9 @@ mT.extrapolateProbsExp = function(table, age, up = TRUE) {
mT.fitExtrapolationLaw = function(table, method = "LF2", law = "HP", mT.fitExtrapolationLaw = function(table, method = "LF2", law = "HP",
fit = 75:99, extrapolate = 80:120, fit = 75:99, extrapolate = 80:120,
fadeIn = 80:90, fadeOut = NULL) { fadeIn = 80:90, fadeOut = NULL) {
if (!is(table, "mortalityTable"))
stop("First argument must be a mortalityTable.")
ages = ages(table) ages = ages(table)
if (!is.null(table@exposures) && !is.na(table@exposures)) { if (!is.null(table@exposures) && !is.na(table@exposures)) {
Ex = table@exposures Ex = table@exposures
...@@ -215,3 +218,16 @@ mT.fitExtrapolationLaw = function(table, method = "LF2", law = "HP", ...@@ -215,3 +218,16 @@ mT.fitExtrapolationLaw = function(table, method = "LF2", law = "HP",
table table
} }
#' @export
mT.setDimInfo = function(table, ..., append = TRUE) {
if (!is(table, "mortalityTable"))
stop("First argument must be a mortalityTable.")
if (append) {
table@data$dim[names(list(...))] = list(...)
} else {
table@data$dim = list(...)
}
table
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment