From 7fe74acb68f66842ad5f6a13644a45f4a35b79d6 Mon Sep 17 00:00:00 2001 From: ayogasekaram Date: Thu, 6 Jul 2023 20:02:00 +0000 Subject: [PATCH 1/2] temp solution for indentation. --- R/tm_t_events.R | 2 +- tests/testthat/_snaps/tm_t_events.md | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/R/tm_t_events.R b/R/tm_t_events.R index f92c6cb749..f2b93119db 100644 --- a/R/tm_t_events.R +++ b/R/tm_t_events.R @@ -246,7 +246,7 @@ template_events <- function(dataname, nonunique = nonunique_label ) ) %>% - count_occurrences(vars = llt, .indent_mods = -1L) %>% + count_occurrences(vars = llt, .indent_mods = c(count_fraction = 1L)) %>% append_varlabels(dataname, llt, indent = 1L), env = list( dataname = as.name(dataname), diff --git a/tests/testthat/_snaps/tm_t_events.md b/tests/testthat/_snaps/tm_t_events.md index ae094017c6..403dbf5b19 100644 --- a/tests/testthat/_snaps/tm_t_events.md +++ b/tests/testthat/_snaps/tm_t_events.md @@ -29,8 +29,8 @@ summarize_num_patients(var = "USUBJID", .stats = c("unique", "nonunique"), .labels = c(unique = "Total number of patients with at least one event", nonunique = "Overall total number of events")) %>% count_occurrences(vars = "AEDECOD", - .indent_mods = -1L) %>% append_varlabels(adae, "AEDECOD", - indent = 1L) + .indent_mods = c(count_fraction = 1L)) %>% append_varlabels(adae, + "AEDECOD", indent = 1L) $table result <- rtables::build_table(lyt = lyt, df = anl, alt_counts_df = adsl) @@ -86,8 +86,8 @@ summarize_num_patients(var = "USUBJID", .stats = c("unique", "nonunique"), .labels = c(unique = "Total number of patients with at least one event", nonunique = "Overall total number of events")) %>% count_occurrences(vars = "AEDECOD", - .indent_mods = -1L) %>% append_varlabels(adae, "AEDECOD", - indent = 1L) + .indent_mods = c(count_fraction = 1L)) %>% append_varlabels(adae, + "AEDECOD", indent = 1L) $table result <- rtables::build_table(lyt = lyt, df = anl, alt_counts_df = adsl) @@ -181,8 +181,8 @@ summarize_num_patients(var = "USUBJID", .stats = c("unique", "nonunique"), .labels = c(unique = "Total number of patients with at least one event", nonunique = "Overall total number of events")) %>% count_occurrences(vars = "AEDECOD", - .indent_mods = -1L) %>% append_varlabels(adae, "AEDECOD", - indent = 1L) + .indent_mods = c(count_fraction = 1L)) %>% append_varlabels(adae, + "AEDECOD", indent = 1L) $table result <- rtables::build_table(lyt = lyt, df = anl, alt_counts_df = adsl) @@ -230,8 +230,8 @@ summarize_num_patients(var = "USUBJID", .stats = c("unique", "nonunique"), .labels = c(unique = "Total number of patients with at least one event", nonunique = "Overall total number of events")) %>% count_occurrences(vars = "AEDECOD", - .indent_mods = -1L) %>% append_varlabels(adae, "AEDECOD", - indent = 1L) + .indent_mods = c(count_fraction = 1L)) %>% append_varlabels(adae, + "AEDECOD", indent = 1L) $table result <- rtables::build_table(lyt = lyt, df = anl, alt_counts_df = adsl) @@ -296,8 +296,8 @@ summarize_num_patients(var = "USUBJID", .stats = c("unique", "nonunique"), .labels = c(unique = "Total number of patients with at least one event", nonunique = "Overall total number of events")) %>% count_occurrences(vars = "AEDECOD", - .indent_mods = -1L) %>% append_varlabels(adae, "AEDECOD", - indent = 1L) + .indent_mods = c(count_fraction = 1L)) %>% append_varlabels(adae, + "AEDECOD", indent = 1L) $table result <- rtables::build_table(lyt = lyt, df = anl, alt_counts_df = adsl) From 8b52fa682a5569406b8d96e14db3d732decd397a Mon Sep 17 00:00:00 2001 From: ayogasekaram Date: Wed, 20 Sep 2023 14:47:05 +0000 Subject: [PATCH 2/2] update news entry --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 9eab08b2f8..a5c6d7c9ad 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,7 @@ * Increased default width of `tm_g_forest_tte` plot to prevent overlapping text. * Improve default annotation table sizing in `tm_g_km`. * Refactored `tm_t_exposure` to display "total" row as last row in table instead of as a summary row. Added parameters `add_total_row` to set whether the total row should be displayed and `total_row_label` to set the total row label. +* Update `tm_t_events` to maintain indentation after pruning. ### Miscellaneous * Updated `control_incidence_rate` parameter names in `tm_t_events_patyear` from `time_unit_input` and `time_unit_output` to `input_time_unit` and `num_pt_year`, respectively, after parameter names were changed in `tern`.