Skip to contents

All abbreviations will be coalesced when printing the final table into a single source note.

Usage

modify_abbreviation(x, abbreviation, text_interpret = c("md", "html"))

remove_abbreviation(x, abbreviation = NULL)

Arguments

x

(gtsummary)
A gtsummary object

abbreviation

(string)
a string. In remove_abbreviation(), the default value is NULL, which will remove all abbreviation source notes.

text_interpret

(string)
String indicates whether text will be interpreted with gt::md() or gt::html(). Must be "md" (default) or "html". Applies to tables printed with {gt}.

Value

Updated gtsummary object

Examples

# Example 1 ----------------------------------
tbl_summary(
  trial,
  by = trt,
  include = age,
  type = age ~ "continuous2"
) |>
  modify_table_body(~dplyr::mutate(.x, label = sub("Q1, Q3", "IQR", x = label))) |>
  modify_abbreviation("IQR = Interquartile Range")
Characteristic Drug A
N = 98
Drug B
N = 102
Age

    Median (IQR) 46 (37, 60) 48 (39, 56)
    Unknown 7 4
Abbreviation: IQR = Interquartile Range
# Example 2 ---------------------------------- lm(marker ~ trt, trial) |> tbl_regression() |> remove_abbreviation("CI = Confidence Interval")
Characteristic Beta 95% CI p-value
Chemotherapy Treatment


    Drug A
    Drug B -0.20 -0.44, 0.05 0.12