Apply a formatting function after the primary formatting functions have been applied.
The function is similar to gt::text_transform()
.
Arguments
- x
(
gtsummary
)
A gtsummary object- fmt_fun
(
function
)
a function that will be applied to the specified columns and rows.- columns
(
tidy-select
)
columns to add footnote.For
modify_footnote_spanning_header()
, pass a single column name where the spanning header begins. If multiple column names are passed, only the first is used.- rows
(predicate
expression
)
Predicate expression to select rows inx$table_body
. Review rows argument details.
Examples
# Example 1 ----------------------------------
data.frame(x = FALSE) |>
tbl_summary(type = x ~ "categorical") |>
modify_post_fmt_fun(
fmt_fun = ~ifelse(. == "0 (0%)", "0", .),
columns = all_stat_cols()
)
Characteristic
N = 11
1 n (%)