From bb51383661a494abe35a0a43e08f7a2fc34be5f5 Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Mon, 12 Dec 2022 17:19:25 +0800 Subject: [PATCH] replace format xx (xx.x%), close #333 (#337) --- R/aet01.R | 4 ++-- R/dst01.R | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/R/aet01.R b/R/aet01.R index 5b5b21555f..6208eb2c43 100755 --- a/R/aet01.R +++ b/R/aet01.R @@ -88,7 +88,7 @@ aet01_1_lyt <- function(armvar, unique = "Total number of patients with at least one AE", nonunique = "Total number of AEs" ), - .formats = list(unique = "xx (xx.x%)", nonunique = "xx") + .formats = list(unique = format_count_fraction_fixed_dp, nonunique = "xx") ) %>% count_patients_with_flags( "USUBJID", @@ -378,7 +378,7 @@ aet01_2_lyt <- function(armvar, unique = "Total number of patients with at least one AE", nonunique = "Total number of AEs" ), - .formats = list(unique = "xx (xx.x%)", nonunique = "xx") + .formats = list(unique = format_count_fraction_fixed_dp, nonunique = "xx") ) %>% count_patients_with_flags( "USUBJID", diff --git a/R/dst01.R b/R/dst01.R index 664087ce90..6d47180ece 100755 --- a/R/dst01.R +++ b/R/dst01.R @@ -133,7 +133,7 @@ dst01_1_lyt <- function(armvar, ) %>% summarize_row_groups( label_fstr = "Discontinued Study", - format = "xx (xx.x%)" + format = format_count_fraction_fixed_dp ) %>% summarize_vars( disc_reason_var, @@ -353,13 +353,13 @@ dst01_2_lyt <- function(armvar, ) %>% summarize_row_groups( label_fstr = "Discontinued Study", - format = "xx (xx.x%)" + format = format_count_fraction_fixed_dp ) %>% split_rows_by( "reasonGP", split_fun = reorder_split_levels(neworder = c("Safety", "Non-Safety")) ) %>% - summarize_row_groups(format = "xx (xx.x%)") %>% + summarize_row_groups(format = format_count_fraction_fixed_dp) %>% summarize_vars( disc_reason_var, .stats = "count_fraction", @@ -586,21 +586,21 @@ dst01_3_lyt <- function(armvar, vars = status_treatment_var, values = completed_trt_lbl, .labels = c(count_fraction = "Completed Treatment"), - .formats = list(count_fraction = "xx (xx.x%)"), + .formats = list(count_fraction = format_count_fraction_fixed_dp), table_names = c("COMPLETED") ) %>% count_values( vars = status_treatment_var, values = ongoing_trt_lbl, .labels = c(count_fraction = "Ongoing Treatment"), - .formats = list(count_fraction = "xx (xx.x%)"), + .formats = list(count_fraction = format_count_fraction_fixed_dp), table_names = c("ONGOING") ) %>% count_values( vars = status_treatment_var, values = discontinued_trt_lbl, .labels = c(count_fraction = "Discontinued Treatment"), - .formats = list(count_fraction = "xx (xx.x%)"), + .formats = list(count_fraction = format_count_fraction_fixed_dp), table_names = c("DISCONTINUED") ) }