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

Allow lists of mortality tables to be passed to plotMortalityTables

parent 2dd8ac4e
No related branches found
No related tags found
No related merge requests found
...@@ -19,12 +19,14 @@ ...@@ -19,12 +19,14 @@
#' #'
#' @export #' @export
makeQxDataFrame = function(..., YOB = 1972, Period = NA, reference = NULL) { makeQxDataFrame = function(..., YOB = 1972, Period = NA, reference = NULL) {
# If reference is given, normalize all probabilities by that table! # Allow lists of tables to be passed, too. unlist should always return
data = list(...); # a list of tables, if if nested lists or only tables are passed as arguments!
data = unlist(list(...));
names(data) = lapply(data, function(t) t@name); names(data) = lapply(data, function(t) t@name);
reference_ages = NULL; reference_ages = NULL;
if (missing(Period)) { if (missing(Period)) {
# If reference is given, normalize all probabilities by that table!
if (!missing(reference)) { if (!missing(reference)) {
reference_ages = ages(reference); reference_ages = ages(reference);
reference = deathProbabilities(reference, YOB = YOB); reference = deathProbabilities(reference, YOB = YOB);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment