# \donttest{
# Basic usage - clean missing values in summary table
demo_trial <- gtsummary::trial |>
dplyr::mutate(
age = dplyr::if_else(trt == "Drug B", 0, age),
marker = dplyr::if_else(trt == "Drug A", NA, marker)
) |>
dplyr::select(trt, age, marker)
demo_trial |>
gtsummary::tbl_summary(by = trt) |>
clean_table()
# Used inside extras() automatically
demo_trial |>
gtsummary::tbl_summary(by = trt) |>
extras()
# Custom missing symbol
demo_trial |>
gtsummary::tbl_summary(by = trt) |>
clean_table(symbol = "???")
# }
Run the code above in your browser using DataLab