From 32ce7ba2ff6004141e43f8a01886660d43300fe9 Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Tue, 10 Jun 2025 23:53:15 +0800 Subject: [PATCH 1/4] alter var_labels --- R/response_subgroups.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/response_subgroups.R b/R/response_subgroups.R index 600ce155d2..1807f65209 100644 --- a/R/response_subgroups.R +++ b/R/response_subgroups.R @@ -354,7 +354,8 @@ tabulate_rsp_subgroups <- function(lyt, var = "row_type", split_fun = keep_split_levels("content"), nested = FALSE, - child_labels = "hidden" + child_labels = "hidden", + var_labels = "row_type" ) lyt_prop <- analyze_colvars( lyt = lyt_prop, @@ -370,7 +371,8 @@ tabulate_rsp_subgroups <- function(lyt, var = "row_type", split_fun = keep_split_levels("analysis"), nested = FALSE, - child_labels = "hidden" + child_labels = "hidden", + var_labels = "row_type2" ) lyt_prop <- split_rows_by(lyt = lyt_prop, var = "var_label", nested = TRUE) lyt_prop <- analyze_colvars( From b32a31e4e87c55dc55d0a219f1764ef8f07aa743 Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Wed, 11 Jun 2025 00:08:26 +0800 Subject: [PATCH 2/4] update --- DESCRIPTION | 2 ++ R/response_subgroups.R | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6498443c95..95d43fc967 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -66,6 +66,8 @@ Suggests: svglite (>= 2.1.2), testthat (>= 3.1.9), withr (>= 2.0.0) +Remotes: + insightsengineering/rtables@main VignetteBuilder: knitr, rmarkdown diff --git a/R/response_subgroups.R b/R/response_subgroups.R index 1807f65209..5c2a320f5f 100644 --- a/R/response_subgroups.R +++ b/R/response_subgroups.R @@ -355,7 +355,7 @@ tabulate_rsp_subgroups <- function(lyt, split_fun = keep_split_levels("content"), nested = FALSE, child_labels = "hidden", - var_labels = "row_type" + labels_var = "row_type" ) lyt_prop <- analyze_colvars( lyt = lyt_prop, @@ -372,7 +372,7 @@ tabulate_rsp_subgroups <- function(lyt, split_fun = keep_split_levels("analysis"), nested = FALSE, child_labels = "hidden", - var_labels = "row_type2" + labels_var = "row_type2" ) lyt_prop <- split_rows_by(lyt = lyt_prop, var = "var_label", nested = TRUE) lyt_prop <- analyze_colvars( From 06f9b92ed5dedc516c91046e934dd8bac2947b0a Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Wed, 11 Jun 2025 21:13:00 +0800 Subject: [PATCH 3/4] fix issue --- R/response_subgroups.R | 10 ++++++---- R/survival_duration_subgroups.R | 12 ++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/R/response_subgroups.R b/R/response_subgroups.R index 5c2a320f5f..e82b8a471a 100644 --- a/R/response_subgroups.R +++ b/R/response_subgroups.R @@ -355,7 +355,7 @@ tabulate_rsp_subgroups <- function(lyt, split_fun = keep_split_levels("content"), nested = FALSE, child_labels = "hidden", - labels_var = "row_type" + parent_name = "All Patients" ) lyt_prop <- analyze_colvars( lyt = lyt_prop, @@ -372,7 +372,7 @@ tabulate_rsp_subgroups <- function(lyt, split_fun = keep_split_levels("analysis"), nested = FALSE, child_labels = "hidden", - labels_var = "row_type2" + parent_name = "analysis rows" ) lyt_prop <- split_rows_by(lyt = lyt_prop, var = "var_label", nested = TRUE) lyt_prop <- analyze_colvars( @@ -403,7 +403,8 @@ tabulate_rsp_subgroups <- function(lyt, var = "row_type", split_fun = keep_split_levels("content"), nested = FALSE, - child_labels = "hidden" + child_labels = "hidden", + parent_name = "All Patients" ) lyt_or <- analyze_colvars( lyt = lyt_or, @@ -420,7 +421,8 @@ tabulate_rsp_subgroups <- function(lyt, var = "row_type", split_fun = keep_split_levels("analysis"), nested = FALSE, - child_labels = "hidden" + child_labels = "hidden", + parent_name = "analysis rows" ) lyt_or <- split_rows_by(lyt = lyt_or, var = "var_label", nested = TRUE) lyt_or <- analyze_colvars( diff --git a/R/survival_duration_subgroups.R b/R/survival_duration_subgroups.R index 4606e03c7f..47ba75ffbd 100644 --- a/R/survival_duration_subgroups.R +++ b/R/survival_duration_subgroups.R @@ -360,7 +360,8 @@ tabulate_survival_subgroups <- function(lyt, var = "row_type", split_fun = keep_split_levels("content"), nested = FALSE, - child_labels = "hidden" + child_labels = "hidden", + parent_name = "All Patients" ) lyt_survtime <- analyze_colvars( lyt = lyt_survtime, @@ -376,7 +377,8 @@ tabulate_survival_subgroups <- function(lyt, var = "row_type", split_fun = keep_split_levels("analysis"), nested = FALSE, - child_labels = "hidden" + child_labels = "hidden", + parent_name = "analysis rows" ) lyt_survtime <- split_rows_by(lyt = lyt_survtime, var = "var_label", nested = TRUE) lyt_survtime <- analyze_colvars( @@ -407,7 +409,8 @@ tabulate_survival_subgroups <- function(lyt, var = "row_type", split_fun = keep_split_levels("content"), nested = FALSE, - child_labels = "hidden" + child_labels = "hidden", + parent_name = "All patient row" ) lyt_hr <- analyze_colvars( lyt = lyt_hr, @@ -424,7 +427,8 @@ tabulate_survival_subgroups <- function(lyt, var = "row_type", split_fun = keep_split_levels("analysis"), nested = FALSE, - child_labels = "hidden" + child_labels = "hidden", + parent_name = "analysis rows" ) lyt_hr <- split_rows_by(lyt = lyt_hr, var = "var_label", nested = TRUE) lyt_hr <- analyze_colvars( From fc99acbbae9692a5f12a2b76509fd42890471375 Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Thu, 12 Jun 2025 11:24:41 +0800 Subject: [PATCH 4/4] update news --- NEWS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS.md b/NEWS.md index add6943aff..96a70da495 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # tern 0.9.8.9002 +### Enhancements +* Code enhancement in `tabulate_rsp_subgroups` and `tabulate_survival_subgroups`, adding `parent_name` when using `split_rows_by` and `analysis` on the same variable multiple times, enhancing the table paths. Upstream enhancement from `rtables`. + ### Bug Fixes * Fixed bug in `g_lineplot()` where `table_format` and `table_labels` arguments were ignored. * Fixed bug in `g_lineplot()` not being able to take a function as a format for table stats.