Hide or unhide columns of a table. Run show_header_names(x, show_hidden = TRUE)
to list the columns, including the hidden ones, that can be shown.
Arguments
- x
(
ltsummary)
An ltsummary object.- columns
(selector)
Columns ofx$table_body.
See also
Other advanced modifiers:
modify_bold_italic,
modify_column_alignment(),
modify_column_merge(),
modify_fmt_fun(),
modify_indent(),
modify_missing_symbol(),
modify_post_fmt_fun(),
tbl_butcher()
Examples
tbl <- trial |>
tbl_summary(by = trt, include = c(age, grade), missing = "no") |>
add_p()
# Example 1 ----------------------------------
# show the test statistic that add_p() stored, and hide the second arm
tbl |>
modify_column_unhide(columns = statistic) |>
modify_fmt_fun(statistic = label_style_sigfig(digits = 3)) |>
modify_header(statistic = "**Statistic**") |>
modify_column_hide(columns = stat_2)