From 4a2675bdcc8e641b00bb6af9c917a11b989a3d73 Mon Sep 17 00:00:00 2001 From: Emily de la Rua <59304861+edelarua@users.noreply.github.com> Date: Mon, 24 Jul 2023 03:36:01 -0400 Subject: [PATCH] Add `nested` argument to all `analyze` wrapper functions (#1009) Closes #999 --- NEWS.md | 1 + R/abnormal.R | 2 ++ R/abnormal_by_baseline.R | 2 ++ R/abnormal_by_marked.R | 2 ++ R/abnormal_by_worst_grade.R | 2 ++ R/abnormal_by_worst_grade_worsen.R | 2 ++ R/argument_convention.R | 4 ++-- R/count_cumulative.R | 2 ++ R/count_missed_doses.R | 2 ++ R/count_occurrences.R | 2 ++ R/count_occurrences_by_grade.R | 2 ++ R/count_patients_with_event.R | 2 ++ R/count_patients_with_flags.R | 2 ++ R/count_values.R | 2 ++ R/estimate_multinomial_rsp.R | 2 ++ R/estimate_proportion.R | 2 ++ R/incidence_rate.R | 2 ++ R/odds_ratio.R | 2 ++ R/prop_diff.R | 2 ++ R/prop_diff_test.R | 2 ++ R/summarize_ancova.R | 2 ++ R/summarize_change.R | 2 ++ R/summarize_glm_count.R | 2 ++ R/summarize_num_patients.R | 2 ++ R/survival_coxph_pairwise.R | 2 ++ R/survival_time.R | 2 ++ R/survival_timepoint.R | 3 +++ man/abnormal.Rd | 5 +++++ man/abnormal_by_baseline.Rd | 5 +++++ man/abnormal_by_marked.Rd | 5 +++++ man/abnormal_by_worst_grade.Rd | 5 +++++ man/abnormal_by_worst_grade_worsen.Rd | 5 +++++ man/analyze_variables.Rd | 4 ++-- man/analyze_vars_in_cols.Rd | 4 ++-- man/argument_convention.Rd | 4 ++-- man/compare_variables.Rd | 4 ++-- man/count_cumulative.Rd | 5 +++++ man/count_missed_doses.Rd | 5 +++++ man/count_occurrences.Rd | 5 +++++ man/count_occurrences_by_grade.Rd | 5 +++++ man/count_patients_with_event.Rd | 5 +++++ man/count_patients_with_flags.Rd | 5 +++++ man/count_values_funs.Rd | 5 +++++ man/estimate_multinomial_rsp.Rd | 5 +++++ man/estimate_proportions.Rd | 5 +++++ man/incidence_rate.Rd | 5 +++++ man/odds_ratio.Rd | 5 +++++ man/prop_diff.Rd | 5 +++++ man/prop_diff_test.Rd | 5 +++++ man/summarize_ancova.Rd | 5 +++++ man/summarize_change.Rd | 5 +++++ man/summarize_glm_count.Rd | 5 +++++ man/summarize_num_patients.Rd | 5 +++++ man/survival_coxph_pairwise.Rd | 5 +++++ man/survival_time.Rd | 5 +++++ man/survival_timepoint.Rd | 5 +++++ 56 files changed, 187 insertions(+), 10 deletions(-) diff --git a/NEWS.md b/NEWS.md index cea0f4b6d7..ad52f95479 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,6 +6,7 @@ * Added `ylim` argument to `g_km` to allow the user to set custom limits for the y-axis. * Added assertion to `g_km` which checks whether there is one arm present in the data when `annot_coxph` is true. * Added `flag_labels` argument to `s_count_patients_with_flags` to enable more label handling options in `count_patients_by_flags`. +* Added the `nested` argument to `analyze` wrapper functions `count_abnormal`, `count_abnormal_by_baseline`, `count_abnormal_by_marked`, `count_abnormal_by_worst_grade`, `count_abnormal_lab_worsen_by_baseline`, `count_cumulative`, `count_missed_doses`, `count_occurrences`, `count_occurrences_by_grade`, `count_patients_with_event`, `count_patients_with_flags`, `count_values`, `estimate_multinomial_response`, `estimate_proportion`, `estimate_incidence_rate`, `estimate_odds_ratio`, `estimate_proportion_diff`, `test_proportion_diff`, `summarize_ancova`, `summarize_change`, `summarize_glm_count`, `analyze_num_patients`, `coxph_pairwise`, `surv_time`, and `surv_timepoint`. ### Miscellaneous * Started deprecation cycle for `summarize_vars` and `control_summarize_vars`. Renamed into `analyze_vars` and `control_analyze_vars` to reflect underlying `rtables` machinery while keeping backward compatibility with aliases. diff --git a/R/abnormal.R b/R/abnormal.R index 34ad3a6550..168f2e7c79 100644 --- a/R/abnormal.R +++ b/R/abnormal.R @@ -140,6 +140,7 @@ a_count_abnormal <- make_afun( #' @export count_abnormal <- function(lyt, var, + nested = TRUE, ..., table_names = var, .stats = NULL, @@ -161,6 +162,7 @@ count_abnormal <- function(lyt, lyt = lyt, vars = var, afun = afun, + nested = nested, table_names = table_names, extra_args = list(...), show_labels = "hidden" diff --git a/R/abnormal_by_baseline.R b/R/abnormal_by_baseline.R index 78efe220a0..9cea4bde1b 100644 --- a/R/abnormal_by_baseline.R +++ b/R/abnormal_by_baseline.R @@ -183,6 +183,7 @@ a_count_abnormal_by_baseline <- make_afun( count_abnormal_by_baseline <- function(lyt, var, abnormal, + nested = TRUE, ..., table_names = abnormal, .stats = NULL, @@ -206,6 +207,7 @@ count_abnormal_by_baseline <- function(lyt, vars = var, var_labels = names(abn), afun = afun, + nested = nested, table_names = table_names[i], extra_args = c(list(abnormal = abn), list(...)), show_labels = "visible" diff --git a/R/abnormal_by_marked.R b/R/abnormal_by_marked.R index bbe5e84241..85c5fc1031 100644 --- a/R/abnormal_by_marked.R +++ b/R/abnormal_by_marked.R @@ -196,6 +196,7 @@ a_count_abnormal_by_marked <- make_afun( #' @export count_abnormal_by_marked <- function(lyt, var, + nested = TRUE, ..., .stats = NULL, .formats = NULL, @@ -216,6 +217,7 @@ count_abnormal_by_marked <- function(lyt, lyt = lyt, vars = var, afun = afun, + nested = nested, show_labels = "hidden", extra_args = c(list(...)) ) diff --git a/R/abnormal_by_worst_grade.R b/R/abnormal_by_worst_grade.R index eb7c47a39f..0addbb1e0c 100644 --- a/R/abnormal_by_worst_grade.R +++ b/R/abnormal_by_worst_grade.R @@ -164,6 +164,7 @@ a_count_abnormal_by_worst_grade <- make_afun( # nolint #' @export count_abnormal_by_worst_grade <- function(lyt, var, + nested = TRUE, ..., .stats = NULL, .formats = NULL, @@ -181,6 +182,7 @@ count_abnormal_by_worst_grade <- function(lyt, lyt = lyt, vars = var, afun = afun, + nested = nested, extra_args = list(...), show_labels = "hidden" ) diff --git a/R/abnormal_by_worst_grade_worsen.R b/R/abnormal_by_worst_grade_worsen.R index 2305c824b7..8979598eea 100644 --- a/R/abnormal_by_worst_grade_worsen.R +++ b/R/abnormal_by_worst_grade_worsen.R @@ -356,6 +356,7 @@ a_count_abnormal_lab_worsen_by_baseline <- make_afun( # nolint #' @export count_abnormal_lab_worsen_by_baseline <- function(lyt, # nolint var, + nested = TRUE, ..., table_names = NULL, .stats = NULL, @@ -376,6 +377,7 @@ count_abnormal_lab_worsen_by_baseline <- function(lyt, # nolint lyt = lyt, vars = var, afun = afun, + nested = nested, extra_args = list(...), show_labels = "hidden" ) diff --git a/R/argument_convention.R b/R/argument_convention.R index 50bbc7eb6c..938f039a75 100644 --- a/R/argument_convention.R +++ b/R/argument_convention.R @@ -37,8 +37,8 @@ #' @param lyt (`layout`)\cr input layout where analyses will be added to. #' @param na.rm (`flag`)\cr whether `NA` values should be removed from `x` prior to analysis. #' @param na_level (`string`)\cr string used to replace all `NA` or empty values in the output. -#' @param nested (`flag`)\cr whether this layout instruction be applied within the existing layout structure _if -#' possible_ (`TRUE`, the default) or as a new top-level element (`FALSE`). Ignored if it would nest a split +#' @param nested (`flag`)\cr whether this layout instruction should be applied within the existing layout structure _if +#' possible_ (`TRUE`, the default) or as a new top-level element (`FALSE`). Ignored if it would nest a split. #' underneath analyses, which is not allowed. #' @param newpage (`flag`)\cr whether the plot should be drawn on a new page. #' Only considered if `draw = TRUE` is used. diff --git a/R/count_cumulative.R b/R/count_cumulative.R index d64219f062..db2c1456a2 100644 --- a/R/count_cumulative.R +++ b/R/count_cumulative.R @@ -151,6 +151,7 @@ count_cumulative <- function(lyt, vars, var_labels = vars, show_labels = "visible", + nested = TRUE, ..., table_names = vars, .stats = NULL, @@ -172,6 +173,7 @@ count_cumulative <- function(lyt, table_names = table_names, var_labels = var_labels, show_labels = show_labels, + nested = nested, extra_args = list(...) ) } diff --git a/R/count_missed_doses.R b/R/count_missed_doses.R index ac970988a6..8d861a030e 100644 --- a/R/count_missed_doses.R +++ b/R/count_missed_doses.R @@ -112,6 +112,7 @@ count_missed_doses <- function(lyt, vars, var_labels = vars, show_labels = "visible", + nested = TRUE, ..., table_names = vars, .stats = NULL, @@ -133,6 +134,7 @@ count_missed_doses <- function(lyt, var_labels = var_labels, table_names = table_names, show_labels = show_labels, + nested = nested, extra_args = list(...) ) } diff --git a/R/count_occurrences.R b/R/count_occurrences.R index c5cfa92b4e..e5f10013c7 100644 --- a/R/count_occurrences.R +++ b/R/count_occurrences.R @@ -169,6 +169,7 @@ count_occurrences <- function(lyt, vars, var_labels = vars, show_labels = "hidden", + nested = TRUE, ..., table_names = vars, .stats = "count_fraction", @@ -191,6 +192,7 @@ count_occurrences <- function(lyt, var_labels = var_labels, show_labels = show_labels, table_names = table_names, + nested = nested, extra_args = list(...) ) } diff --git a/R/count_occurrences_by_grade.R b/R/count_occurrences_by_grade.R index ac51551265..3ae250b66b 100644 --- a/R/count_occurrences_by_grade.R +++ b/R/count_occurrences_by_grade.R @@ -260,6 +260,7 @@ count_occurrences_by_grade <- function(lyt, var, var_labels = var, show_labels = "default", + nested = TRUE, ..., table_names = var, .stats = NULL, @@ -281,6 +282,7 @@ count_occurrences_by_grade <- function(lyt, show_labels = show_labels, afun = afun, table_names = table_names, + nested = nested, extra_args = list(...) ) } diff --git a/R/count_patients_with_event.R b/R/count_patients_with_event.R index 527ae9f52e..4e3a0df2cb 100644 --- a/R/count_patients_with_event.R +++ b/R/count_patients_with_event.R @@ -144,6 +144,7 @@ a_count_patients_with_event <- make_afun( #' @export count_patients_with_event <- function(lyt, vars, + nested = TRUE, ..., table_names = vars, .stats = "count_fraction", @@ -162,6 +163,7 @@ count_patients_with_event <- function(lyt, lyt, vars, afun = afun, + nested = nested, extra_args = list(...), show_labels = ifelse(length(vars) > 1, "visible", "hidden"), table_names = table_names diff --git a/R/count_patients_with_flags.R b/R/count_patients_with_flags.R index 94bd28f246..3891973228 100644 --- a/R/count_patients_with_flags.R +++ b/R/count_patients_with_flags.R @@ -157,6 +157,7 @@ count_patients_with_flags <- function(lyt, var, var_labels = var, show_labels = "hidden", + nested = TRUE, ..., table_names = paste0("tbl_flags_", var), .stats = "count_fraction", @@ -177,6 +178,7 @@ count_patients_with_flags <- function(lyt, show_labels = show_labels, afun = afun, table_names = table_names, + nested = nested, extra_args = list(...) ) diff --git a/R/count_values.R b/R/count_values.R index f60332cabd..35b866e96f 100644 --- a/R/count_values.R +++ b/R/count_values.R @@ -122,6 +122,7 @@ a_count_values <- make_afun( count_values <- function(lyt, vars, values, + nested = TRUE, ..., table_names = vars, .stats = "count_fraction", @@ -139,6 +140,7 @@ count_values <- function(lyt, lyt, vars, afun = afun, + nested = nested, extra_args = c(list(values = values), list(...)), show_labels = ifelse(length(vars) > 1, "visible", "hidden"), table_names = table_names diff --git a/R/estimate_multinomial_rsp.R b/R/estimate_multinomial_rsp.R index 1da7328355..8a3c1124cb 100644 --- a/R/estimate_multinomial_rsp.R +++ b/R/estimate_multinomial_rsp.R @@ -146,6 +146,7 @@ a_length_proportion <- make_afun( #' @export estimate_multinomial_response <- function(lyt, var, + nested = TRUE, ..., show_labels = "hidden", table_names = var, @@ -169,6 +170,7 @@ estimate_multinomial_response <- function(lyt, afun = afun, show_labels = show_labels, table_names = table_names, + nested = nested, extra_args = list(...) ) } diff --git a/R/estimate_proportion.R b/R/estimate_proportion.R index 7a5dcdcd5e..7e212811b9 100644 --- a/R/estimate_proportion.R +++ b/R/estimate_proportion.R @@ -162,6 +162,7 @@ a_proportion <- make_afun( #' @export estimate_proportion <- function(lyt, vars, + nested = TRUE, ..., show_labels = "hidden", table_names = vars, @@ -180,6 +181,7 @@ estimate_proportion <- function(lyt, lyt, vars, afun = afun, + nested = nested, extra_args = list(...), show_labels = show_labels, table_names = table_names diff --git a/R/incidence_rate.R b/R/incidence_rate.R index 2f18955570..3ad8355277 100644 --- a/R/incidence_rate.R +++ b/R/incidence_rate.R @@ -135,6 +135,7 @@ a_incidence_rate <- make_afun( #' @export estimate_incidence_rate <- function(lyt, vars, + nested = TRUE, ..., show_labels = "hidden", table_names = vars, @@ -156,6 +157,7 @@ estimate_incidence_rate <- function(lyt, show_labels = show_labels, table_names = table_names, afun = afun, + nested = nested, extra_args = list(...) ) } diff --git a/R/odds_ratio.R b/R/odds_ratio.R index 206e528eeb..089861cff6 100644 --- a/R/odds_ratio.R +++ b/R/odds_ratio.R @@ -188,6 +188,7 @@ a_odds_ratio <- make_afun( #' @export estimate_odds_ratio <- function(lyt, vars, + nested = TRUE, ..., show_labels = "hidden", table_names = vars, @@ -207,6 +208,7 @@ estimate_odds_ratio <- function(lyt, lyt, vars, afun = afun, + nested = nested, extra_args = list(...), show_labels = show_labels, table_names = table_names diff --git a/R/prop_diff.R b/R/prop_diff.R index 35c163243d..4612b6f00d 100644 --- a/R/prop_diff.R +++ b/R/prop_diff.R @@ -191,6 +191,7 @@ a_proportion_diff <- make_afun( #' @export estimate_proportion_diff <- function(lyt, vars, + nested = TRUE, ..., var_labels = vars, show_labels = "hidden", @@ -212,6 +213,7 @@ estimate_proportion_diff <- function(lyt, vars, afun = afun, var_labels = var_labels, + nested = nested, extra_args = list(...), show_labels = show_labels, table_names = table_names diff --git a/R/prop_diff_test.R b/R/prop_diff_test.R index 0fc3942f01..67272fee75 100644 --- a/R/prop_diff_test.R +++ b/R/prop_diff_test.R @@ -136,6 +136,7 @@ a_test_proportion_diff <- make_afun( #' @export test_proportion_diff <- function(lyt, vars, + nested = TRUE, ..., var_labels = vars, show_labels = "hidden", @@ -156,6 +157,7 @@ test_proportion_diff <- function(lyt, vars, afun = afun, var_labels = var_labels, + nested = nested, extra_args = list(...), show_labels = show_labels, table_names = table_names diff --git a/R/summarize_ancova.R b/R/summarize_ancova.R index 541f79533b..d392929469 100644 --- a/R/summarize_ancova.R +++ b/R/summarize_ancova.R @@ -244,6 +244,7 @@ a_ancova <- make_afun( summarize_ancova <- function(lyt, vars, var_labels, + nested = TRUE, ..., show_labels = "visible", table_names = vars, @@ -270,6 +271,7 @@ summarize_ancova <- function(lyt, show_labels = show_labels, table_names = table_names, afun = afun, + nested = nested, extra_args = list(...) ) } diff --git a/R/summarize_change.R b/R/summarize_change.R index e6627ae82e..f23b994179 100644 --- a/R/summarize_change.R +++ b/R/summarize_change.R @@ -120,6 +120,7 @@ a_change_from_baseline <- make_afun( #' @export summarize_change <- function(lyt, vars, + nested = TRUE, ..., table_names = vars, .stats = c("n", "mean_sd", "median", "range"), @@ -138,6 +139,7 @@ summarize_change <- function(lyt, lyt, vars, afun = afun, + nested = nested, extra_args = list(...), table_names = table_names ) diff --git a/R/summarize_glm_count.R b/R/summarize_glm_count.R index 1ddc7b89ea..afff57b9e4 100644 --- a/R/summarize_glm_count.R +++ b/R/summarize_glm_count.R @@ -400,6 +400,7 @@ a_glm_count <- make_afun( summarize_glm_count <- function(lyt, vars, var_labels, + nested = TRUE, ..., show_labels = "visible", table_names = vars, @@ -422,6 +423,7 @@ summarize_glm_count <- function(lyt, show_labels = show_labels, table_names = table_names, afun = afun, + nested = nested, extra_args = list(...) ) } diff --git a/R/summarize_num_patients.R b/R/summarize_num_patients.R index 92d7a8588a..83207eb48a 100644 --- a/R/summarize_num_patients.R +++ b/R/summarize_num_patients.R @@ -203,6 +203,7 @@ summarize_num_patients <- function(lyt, #' @export analyze_num_patients <- function(lyt, vars, + nested = TRUE, .stats = NULL, .formats = NULL, .labels = c( @@ -232,6 +233,7 @@ analyze_num_patients <- function(lyt, afun = afun, lyt = lyt, vars = vars, + nested = nested, extra_args = list(...), show_labels = show_labels, indent_mod = .indent_mods diff --git a/R/survival_coxph_pairwise.R b/R/survival_coxph_pairwise.R index ef79011a0e..a06f7ed3b3 100644 --- a/R/survival_coxph_pairwise.R +++ b/R/survival_coxph_pairwise.R @@ -165,6 +165,7 @@ a_coxph_pairwise <- make_afun( #' @export coxph_pairwise <- function(lyt, vars, + nested = TRUE, ..., var_labels = "CoxPH", show_labels = "visible", @@ -187,6 +188,7 @@ coxph_pairwise <- function(lyt, show_labels = show_labels, table_names = table_names, afun = afun, + nested = nested, extra_args = list(...) ) } diff --git a/R/survival_time.R b/R/survival_time.R index b69dfa4647..cf5d0b140a 100644 --- a/R/survival_time.R +++ b/R/survival_time.R @@ -123,6 +123,7 @@ a_surv_time <- make_afun( #' @export surv_time <- function(lyt, vars, + nested = TRUE, ..., var_labels = "Time to Event", table_names = vars, @@ -143,6 +144,7 @@ surv_time <- function(lyt, analyze( lyt, vars, + nested = nested, var_labels = var_labels, show_labels = "visible", table_names = table_names, diff --git a/R/survival_timepoint.R b/R/survival_timepoint.R index 7745105003..fcd31d5460 100644 --- a/R/survival_timepoint.R +++ b/R/survival_timepoint.R @@ -232,6 +232,7 @@ a_surv_timepoint_diff <- make_afun( #' @export surv_timepoint <- function(lyt, vars, + nested = TRUE, ..., table_names_suffix = "", var_labels = "Time", @@ -289,6 +290,7 @@ surv_timepoint <- function(lyt, table_names = paste0("surv_", tpt, table_names_suffix), show_labels = show_labels, afun = afun_surv, + nested = nested, extra_args = list( is_event = list(...)$is_event, control = list(...)$control, @@ -305,6 +307,7 @@ surv_timepoint <- function(lyt, table_names = paste0("surv_diff_", tpt, table_names_suffix), show_labels = ifelse(method == "both", "hidden", show_labels), afun = afun_surv_diff, + nested = nested, extra_args = list( is_event = list(...)$is_event, control = list(...)$control, diff --git a/man/abnormal.Rd b/man/abnormal.Rd index 28bdebb62e..3f0349ca8e 100644 --- a/man/abnormal.Rd +++ b/man/abnormal.Rd @@ -26,6 +26,7 @@ a_count_abnormal( count_abnormal( lyt, var, + nested = TRUE, ..., table_names = var, .stats = NULL, @@ -51,6 +52,10 @@ from numerator and denominator.} \item{lyt}{(\code{layout})\cr input layout where analyses will be added to.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, diff --git a/man/abnormal_by_baseline.Rd b/man/abnormal_by_baseline.Rd index f9679624c3..35397fcef2 100644 --- a/man/abnormal_by_baseline.Rd +++ b/man/abnormal_by_baseline.Rd @@ -27,6 +27,7 @@ count_abnormal_by_baseline( lyt, var, abnormal, + nested = TRUE, ..., table_names = abnormal, .stats = NULL, @@ -50,6 +51,10 @@ by a statistics function.} \item{lyt}{(\code{layout})\cr input layout where analyses will be added to.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, diff --git a/man/abnormal_by_marked.Rd b/man/abnormal_by_marked.Rd index aa226d8895..35bee32c19 100644 --- a/man/abnormal_by_marked.Rd +++ b/man/abnormal_by_marked.Rd @@ -26,6 +26,7 @@ a_count_abnormal_by_marked( count_abnormal_by_marked( lyt, var, + nested = TRUE, ..., .stats = NULL, .formats = NULL, @@ -49,6 +50,10 @@ and last or replicated.} \item{lyt}{(\code{layout})\cr input layout where analyses will be added to.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{.stats}{(\code{character})\cr statistics to select for the table.} diff --git a/man/abnormal_by_worst_grade.Rd b/man/abnormal_by_worst_grade.Rd index e25635ddd4..0bba09f2a4 100644 --- a/man/abnormal_by_worst_grade.Rd +++ b/man/abnormal_by_worst_grade.Rd @@ -24,6 +24,7 @@ a_count_abnormal_by_worst_grade( count_abnormal_by_worst_grade( lyt, var, + nested = TRUE, ..., .stats = NULL, .formats = NULL, @@ -44,6 +45,10 @@ that is passed by \code{rtables}.} \item{lyt}{(\code{layout})\cr input layout where analyses will be added to.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{.stats}{(\code{character})\cr statistics to select for the table.} diff --git a/man/abnormal_by_worst_grade_worsen.Rd b/man/abnormal_by_worst_grade_worsen.Rd index a46a77409e..a915594b6a 100644 --- a/man/abnormal_by_worst_grade_worsen.Rd +++ b/man/abnormal_by_worst_grade_worsen.Rd @@ -22,6 +22,7 @@ a_count_abnormal_lab_worsen_by_baseline( count_abnormal_lab_worsen_by_baseline( lyt, var, + nested = TRUE, ..., table_names = NULL, .stats = NULL, @@ -45,6 +46,10 @@ by a statistics function.} \item{lyt}{(\code{layout})\cr input layout where analyses will be added to.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, diff --git a/man/analyze_variables.Rd b/man/analyze_variables.Rd index c34b1b5dcc..8b0342a603 100644 --- a/man/analyze_variables.Rd +++ b/man/analyze_variables.Rd @@ -157,8 +157,8 @@ to print out information about factor casting.} \item{var_labels}{(\code{character})\cr character for label.} -\item{nested}{(\code{flag})\cr whether this layout instruction be applied within the existing layout structure \emph{if -possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. underneath analyses, which is not allowed.} \item{na_level}{(\code{string})\cr string used to replace all \code{NA} or empty values in the output.} diff --git a/man/analyze_vars_in_cols.Rd b/man/analyze_vars_in_cols.Rd index 9804e8eb24..5a6d7eaf3f 100644 --- a/man/analyze_vars_in_cols.Rd +++ b/man/analyze_vars_in_cols.Rd @@ -47,8 +47,8 @@ without adding more splits. This split must happen only one time on a single lay \item{.indent_mods}{(named \code{integer})\cr indent modifiers for the labels. Defaults to 0, which corresponds to the unmodified default behavior. Can be negative.} -\item{nested}{(\code{flag})\cr whether this layout instruction be applied within the existing layout structure \emph{if -possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. underneath analyses, which is not allowed.} \item{na_level}{(\code{string})\cr string used to replace all \code{NA} or empty values in the output.} diff --git a/man/argument_convention.Rd b/man/argument_convention.Rd index 40c0dfff85..70e077b239 100644 --- a/man/argument_convention.Rd +++ b/man/argument_convention.Rd @@ -64,8 +64,8 @@ for more information.} \item{na_level}{(\code{string})\cr string used to replace all \code{NA} or empty values in the output.} -\item{nested}{(\code{flag})\cr whether this layout instruction be applied within the existing layout structure \emph{if -possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. underneath analyses, which is not allowed.} \item{newpage}{(\code{flag})\cr whether the plot should be drawn on a new page. diff --git a/man/compare_variables.Rd b/man/compare_variables.Rd index 2626f42de8..ac851ab11f 100644 --- a/man/compare_variables.Rd +++ b/man/compare_variables.Rd @@ -94,8 +94,8 @@ to print out information about factor casting. Defaults to \code{TRUE}.} \item{var_labels}{(\code{character})\cr character for label.} -\item{nested}{(\code{flag})\cr whether this layout instruction be applied within the existing layout structure \emph{if -possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. underneath analyses, which is not allowed.} \item{na_level}{(\code{string})\cr string used to replace all \code{NA} or empty values in the output.} diff --git a/man/count_cumulative.Rd b/man/count_cumulative.Rd index c99a1edbb3..954bf654fe 100644 --- a/man/count_cumulative.Rd +++ b/man/count_cumulative.Rd @@ -29,6 +29,7 @@ count_cumulative( vars, var_labels = vars, show_labels = "visible", + nested = TRUE, ..., table_names = vars, .stats = NULL, @@ -59,6 +60,10 @@ count, default is \code{TRUE}.} \item{show_labels}{(\code{string})\cr label visibility: one of "default", "visible" and "hidden".} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} diff --git a/man/count_missed_doses.Rd b/man/count_missed_doses.Rd index f1591d122e..38d4147326 100644 --- a/man/count_missed_doses.Rd +++ b/man/count_missed_doses.Rd @@ -18,6 +18,7 @@ count_missed_doses( vars, var_labels = vars, show_labels = "visible", + nested = TRUE, ..., table_names = vars, .stats = NULL, @@ -42,6 +43,10 @@ count_missed_doses( \item{show_labels}{(\code{string})\cr label visibility: one of "default", "visible" and "hidden".} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, diff --git a/man/count_occurrences.Rd b/man/count_occurrences.Rd index 4c79bfced0..277b70aee4 100644 --- a/man/count_occurrences.Rd +++ b/man/count_occurrences.Rd @@ -31,6 +31,7 @@ count_occurrences( vars, var_labels = vars, show_labels = "hidden", + nested = TRUE, ..., table_names = vars, .stats = "count_fraction", @@ -69,6 +70,10 @@ by a statistics function.} \item{show_labels}{(\code{string})\cr label visibility: one of "default", "visible" and "hidden".} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, diff --git a/man/count_occurrences_by_grade.Rd b/man/count_occurrences_by_grade.Rd index 03491055f5..52532b8ad2 100644 --- a/man/count_occurrences_by_grade.Rd +++ b/man/count_occurrences_by_grade.Rd @@ -32,6 +32,7 @@ count_occurrences_by_grade( var, var_labels = var, show_labels = "default", + nested = TRUE, ..., table_names = var, .stats = NULL, @@ -76,6 +77,10 @@ for more information.} \item{show_labels}{(\code{string})\cr label visibility: one of "default", "visible" and "hidden".} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, diff --git a/man/count_patients_with_event.Rd b/man/count_patients_with_event.Rd index da2d933932..330384c634 100644 --- a/man/count_patients_with_event.Rd +++ b/man/count_patients_with_event.Rd @@ -27,6 +27,7 @@ a_count_patients_with_event( count_patients_with_event( lyt, vars, + nested = TRUE, ..., table_names = vars, .stats = "count_fraction", @@ -62,6 +63,10 @@ Note that only equality is being accepted as condition.} \item{vars}{(\code{character})\cr variable names for the primary analysis variable to be iterated over.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, diff --git a/man/count_patients_with_flags.Rd b/man/count_patients_with_flags.Rd index 2b796bb98d..a53ea0cb23 100644 --- a/man/count_patients_with_flags.Rd +++ b/man/count_patients_with_flags.Rd @@ -31,6 +31,7 @@ count_patients_with_flags( var, var_labels = var, show_labels = "hidden", + nested = TRUE, ..., table_names = paste0("tbl_flags_", var), .stats = "count_fraction", @@ -69,6 +70,10 @@ by a statistics function.} \item{show_labels}{(\code{string})\cr label visibility: one of "default", "visible" and "hidden".} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, diff --git a/man/count_values_funs.Rd b/man/count_values_funs.Rd index a19af415e1..e4ea6cbd91 100644 --- a/man/count_values_funs.Rd +++ b/man/count_values_funs.Rd @@ -38,6 +38,7 @@ count_values( lyt, vars, values, + nested = TRUE, ..., table_names = vars, .stats = "count_fraction", @@ -71,6 +72,10 @@ count_values( \item{vars}{(\code{character})\cr variable names for the primary analysis variable to be iterated over.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} diff --git a/man/estimate_multinomial_rsp.Rd b/man/estimate_multinomial_rsp.Rd index 198b08a3ce..546a5f942e 100644 --- a/man/estimate_multinomial_rsp.Rd +++ b/man/estimate_multinomial_rsp.Rd @@ -14,6 +14,7 @@ a_length_proportion(x, .N_col, ...) estimate_multinomial_response( lyt, var, + nested = TRUE, ..., show_labels = "hidden", table_names = var, @@ -36,6 +37,10 @@ estimate_multinomial_response( \item{var}{(\code{string})\cr single variable name that is passed by \code{rtables} when requested by a statistics function.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{show_labels}{(\code{string})\cr label visibility: one of "default", "visible" and "hidden".} \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, diff --git a/man/estimate_proportions.Rd b/man/estimate_proportions.Rd index aae7235b38..1febd7aeea 100644 --- a/man/estimate_proportions.Rd +++ b/man/estimate_proportions.Rd @@ -34,6 +34,7 @@ a_proportion( estimate_proportion( lyt, vars, + nested = TRUE, ..., show_labels = "hidden", table_names = vars, @@ -75,6 +76,10 @@ to find estimates of optimal weights.} \item{vars}{(\code{character})\cr variable names for the primary analysis variable to be iterated over.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{other arguments are ultimately conveyed to \code{\link[=s_proportion]{s_proportion()}}.} \item{show_labels}{(\code{string})\cr label visibility: one of "default", "visible" and "hidden".} diff --git a/man/incidence_rate.Rd b/man/incidence_rate.Rd index 0c5dd5d0ce..50ac062141 100644 --- a/man/incidence_rate.Rd +++ b/man/incidence_rate.Rd @@ -26,6 +26,7 @@ a_incidence_rate( estimate_incidence_rate( lyt, vars, + nested = TRUE, ..., show_labels = "hidden", table_names = vars, @@ -60,6 +61,10 @@ indicating time unit for data input. \item{vars}{(\code{character})\cr variable names for the primary analysis variable to be iterated over.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{show_labels}{(\code{string})\cr label visibility: one of "default", "visible" and "hidden".} diff --git a/man/odds_ratio.Rd b/man/odds_ratio.Rd index 0f52259c10..4c5754386b 100644 --- a/man/odds_ratio.Rd +++ b/man/odds_ratio.Rd @@ -32,6 +32,7 @@ a_odds_ratio( estimate_odds_ratio( lyt, vars, + nested = TRUE, ..., show_labels = "hidden", table_names = vars, @@ -64,6 +65,10 @@ levels that belong to it in the character vectors that are elements of the list. \item{vars}{(\code{character})\cr variable names for the primary analysis variable to be iterated over.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{arguments passed to \code{s_odds_ratio()}.} \item{show_labels}{(\code{string})\cr label visibility: one of "default", "visible" and "hidden".} diff --git a/man/prop_diff.Rd b/man/prop_diff.Rd index 20e6e3565d..29828a4836 100644 --- a/man/prop_diff.Rd +++ b/man/prop_diff.Rd @@ -34,6 +34,7 @@ a_proportion_diff( estimate_proportion_diff( lyt, vars, + nested = TRUE, ..., var_labels = vars, show_labels = "hidden", @@ -67,6 +68,10 @@ and directs the way weights are estimated.} \item{vars}{(\code{character})\cr variable names for the primary analysis variable to be iterated over.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{arguments passed to \code{s_proportion_diff()}.} \item{var_labels}{(\code{character})\cr character for label.} diff --git a/man/prop_diff_test.Rd b/man/prop_diff_test.Rd index da94602361..7725db1fde 100644 --- a/man/prop_diff_test.Rd +++ b/man/prop_diff_test.Rd @@ -28,6 +28,7 @@ a_test_proportion_diff( test_proportion_diff( lyt, vars, + nested = TRUE, ..., var_labels = vars, show_labels = "hidden", @@ -57,6 +58,10 @@ to calculate the p-value.} \item{vars}{(\code{character})\cr variable names for the primary analysis variable to be iterated over.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{other arguments are passed to \code{\link[=s_test_proportion_diff]{s_test_proportion_diff()}}.} \item{var_labels}{(\code{character})\cr character for label.} diff --git a/man/summarize_ancova.Rd b/man/summarize_ancova.Rd index 234b85923c..8f4bda9486 100644 --- a/man/summarize_ancova.Rd +++ b/man/summarize_ancova.Rd @@ -34,6 +34,7 @@ summarize_ancova( lyt, vars, var_labels, + nested = TRUE, ..., show_labels = "visible", table_names = vars, @@ -73,6 +74,10 @@ with arm. if the interaction is not needed, the default option is \code{NULL}.} \item{var_labels}{(\code{character})\cr character for label.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{show_labels}{(\code{string})\cr label visibility: one of "default", "visible" and "hidden".} diff --git a/man/summarize_change.Rd b/man/summarize_change.Rd index 5009f166d0..a4ca2ad2f6 100644 --- a/man/summarize_change.Rd +++ b/man/summarize_change.Rd @@ -13,6 +13,7 @@ a_change_from_baseline(df, .var, variables, na.rm = TRUE, ...) summarize_change( lyt, vars, + nested = TRUE, ..., table_names = vars, .stats = c("n", "mean_sd", "median", "range"), @@ -37,6 +38,10 @@ by a statistics function.} \item{vars}{(\code{character})\cr variable names for the primary analysis variable to be iterated over.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{table_names}{(\code{character})\cr this can be customized in case that the same \code{vars} are analyzed multiple times, to avoid warnings from \code{rtables}.} diff --git a/man/summarize_glm_count.Rd b/man/summarize_glm_count.Rd index c2ecc727b8..be85f3eb4d 100644 --- a/man/summarize_glm_count.Rd +++ b/man/summarize_glm_count.Rd @@ -38,6 +38,7 @@ summarize_glm_count( lyt, vars, var_labels, + nested = TRUE, ..., show_labels = "visible", table_names = vars, @@ -69,6 +70,10 @@ by a statistics function.} \item{var_labels}{(\code{character})\cr character for label.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{show_labels}{(\code{string})\cr label visibility: one of "default", "visible" and "hidden".} diff --git a/man/summarize_num_patients.Rd b/man/summarize_num_patients.Rd index de209b71e4..6791f8e99e 100644 --- a/man/summarize_num_patients.Rd +++ b/man/summarize_num_patients.Rd @@ -40,6 +40,7 @@ summarize_num_patients( analyze_num_patients( lyt, vars, + nested = TRUE, .stats = NULL, .formats = NULL, .labels = c(unique = "Number of patients with at least one event", nonunique = @@ -90,6 +91,10 @@ unmodified default behavior. Can be negative.} \item{vars}{(\code{character})\cr variable names for the primary analysis variable to be iterated over.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{show_labels}{(\code{string})\cr label visibility: one of "default", "visible" and "hidden".} } \value{ diff --git a/man/survival_coxph_pairwise.Rd b/man/survival_coxph_pairwise.Rd index aba31811ee..fc47f96193 100644 --- a/man/survival_coxph_pairwise.Rd +++ b/man/survival_coxph_pairwise.Rd @@ -30,6 +30,7 @@ a_coxph_pairwise( coxph_pairwise( lyt, vars, + nested = TRUE, ..., var_labels = "CoxPH", show_labels = "visible", @@ -68,6 +69,10 @@ can also be set to \code{"breslow"} or \code{"exact"}. See more in \code{\link[s \item{vars}{(\code{character})\cr variable names for the primary analysis variable to be iterated over.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{var_labels}{(\code{character})\cr character for label.} diff --git a/man/survival_time.Rd b/man/survival_time.Rd index e18f897d2f..22c697703f 100644 --- a/man/survival_time.Rd +++ b/man/survival_time.Rd @@ -14,6 +14,7 @@ a_surv_time(df, .var, is_event, control = control_surv_time()) surv_time( lyt, vars, + nested = TRUE, ..., var_labels = "Time to Event", table_names = vars, @@ -45,6 +46,10 @@ see more in \code{\link[survival:survfit]{survival::survfit()}}. Note option "no \item{vars}{(\code{character})\cr variable names for the primary analysis variable to be iterated over.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{...}{additional arguments for the lower level functions.} \item{var_labels}{(\code{character})\cr character for label.} diff --git a/man/survival_timepoint.Rd b/man/survival_timepoint.Rd index f41e4ff3fb..d8d363827d 100644 --- a/man/survival_timepoint.Rd +++ b/man/survival_timepoint.Rd @@ -48,6 +48,7 @@ a_surv_timepoint_diff( surv_timepoint( lyt, vars, + nested = TRUE, ..., table_names_suffix = "", var_labels = "Time", @@ -94,6 +95,10 @@ see more in \code{\link[survival:survfit]{survival::survfit()}}. Note option "no \item{vars}{(\code{character})\cr variable names for the primary analysis variable to be iterated over.} +\item{nested}{(\code{flag})\cr whether this layout instruction should be applied within the existing layout structure \emph{if +possible} (\code{TRUE}, the default) or as a new top-level element (\code{FALSE}). Ignored if it would nest a split. +underneath analyses, which is not allowed.} + \item{table_names_suffix}{(\code{string})\cr optional suffix for the \code{table_names} used for the \code{rtables} to avoid warnings from duplicate table names.}