modify_bold_italic: Modify Bold and Italic

modify_bold_italicR Documentation

Modify Bold and Italic

Description

Add or remove bold and italic styling to a cell in a table.

Usage

modify_bold(x, columns, rows)

remove_bold(x, columns, rows)

modify_italic(x, columns, rows)

remove_italic(x, columns, rows)

Arguments

x

(gtsummary)
A gtsummary object

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 in x$table_body. Review rows argument details.

Value

Updated gtsummary object

Examples


# Example 1 ----------------------------------
tbl <- trial |>
  tbl_summary(include = grade) |>
  modify_bold(columns = label, rows = row_type == "label") |>
  modify_italic(columns = label, rows = row_type == "level")
tbl

# Example 2 ----------------------------------
tbl |>
  remove_bold(columns = label, rows = row_type == "label") |>
  remove_italic(columns = label, rows = row_type == "level")


gtsummary documentation built on April 3, 2025, 10:18 p.m.