Skip to contents

Add, increase, or reduce indentation for columns.

Usage

modify_indent(x, columns, rows = NULL, indent = 4L, double_indent, undo)

Arguments

x

(gtsummary)
A gtsummary object

columns

(tidy-select)
Selector of columns in x$table_body

rows

(predicate expression)
Predicate expression to select rows in x$table_body. Review rows argument details.

indent

(integer)
An integer indicating how many space to indent text

double_indent, undo

[Deprecated]

Value

a gtsummary table

See also

Other Advanced modifiers: modify_column_merge(), modify_table_styling()

Examples

# remove indentation from `tbl_summary()`
trial |>
  tbl_summary(include = grade) |>
  modify_indent(columns = label, indent = 0L)
Characteristic N = 2001
Grade
I 68 (34%)
II 68 (34%)
III 64 (32%)
1 n (%)
# increase indentation in `tbl_summary` trial |> tbl_summary(include = grade) |> modify_indent(columns = label, rows = !row_type %in% 'label', indent = 8L)
Characteristic N = 2001
Grade
        I 68 (34%)
        II 68 (34%)
        III 64 (32%)
1 n (%)