Add or remove bold and italic styling to a cell in a table. By default, the remove functions will remove all bold/italic styling.
modify_bold(x, columns, rows)
remove_bold(x, columns = everything(), rows = TRUE)
modify_italic(x, columns, rows)
remove_italic(x, columns = everything(), rows = TRUE)
(gtsummary
)
A gtsummary object
(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.
(predicate expression
)
Predicate expression to select rows in x$table_body
.
Review rows argument details.
Updated gtsummary object
# 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
1 n (%)
# Example 2 ----------------------------------
tbl |>
remove_bold(columns = label, rows = row_type == "label") |>
remove_italic(columns = label, rows = row_type == "level")
Characteristic
N = 2001
1 n (%)