Set bold and/or italic style for groups labels in stacked tables

bold_italicize_group_labels(
  x,
  bold = FALSE,
  italics = FALSE,
  print_engine = c("gt", "flextable", "huxtable")
)

Arguments

x

a gtsummary stacked table

bold

logical indicating whether to bold the group header rows

italics

logical indicating whether to italicize the group header rows

print_engine

Choose a print engine to render the table, must be one of c("gt", "flextable", "huxtable")

Value

A table of class selected in print_engine. Of note, the output will no longer be a gtsummary table.

Example Output

Example 1

Examples

library(gtsummary)

bold_italicize_group_labels_ex1 <-
  trial %>%
  select(age, trt, grade) %>%
  tbl_strata(
    strata = grade,
    ~ .x %>%
      tbl_summary(by = trt, missing = "no"),
    .combine_with = "tbl_stack"
  ) %>%
  bold_italicize_group_labels(bold = TRUE)
#>  Column headers among stacked tables differ. Headers from the first table are
#> used. Use `quiet = TRUE` to supress this message.
#>  gtsummary table has been converted class "gt"