Skip to contents

Add or remove bold and italic styling to a cell in a table. By default, the remove functions will remove all bold/italic styling.

Usage

modify_bold(x, columns, rows)

remove_bold(x, columns = everything(), rows = TRUE)

modify_italic(x, columns, rows)

remove_italic(x, columns = everything(), rows = TRUE)

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
Characteristic N = 2001
Grade
    I 68 (34%)
    II 68 (34%)
    III 64 (32%)
1 n (%)
# Example 2 ---------------------------------- tbl |> remove_bold(columns = label, rows = row_type == "label") |> remove_italic(columns = label, rows = row_type == "level")
Characteristic N = 2001
Grade
    I 68 (34%)
    II 68 (34%)
    III 64 (32%)
1 n (%)