Skip to content

Commit

Permalink
replace format xx (xx.x%), close #333 (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
shajoezhu authored Dec 12, 2022
1 parent e46b156 commit bb51383
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions R/aet01.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions R/dst01.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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")
)
}
Expand Down

0 comments on commit bb51383

Please sign in to comment.