R/custom_headers.R
custom_headers.RdThis function customizes the column headers, optional spanning header, and table caption
for a gtsummary table. It supports adding a feature name, total label, group title, and
formats missing data presentation.
custom_headers(
base_table_missing,
var_characteristic = NULL,
show_missing_data = TRUE,
show_n_per_group = TRUE,
var_tot = NULL,
var_group = NULL,
group_title = NULL,
table_title
)A gtsummary table object (typically output from previous steps).
Optional. A string to label the features column.
Logical. If TRUE, adds missing data info to column headers.
A boolean indicating whether to display group sizes (n) for each level of the grouping variable.
Optional. A string to label the total column.
Optional. Name of a grouping variable for adding a spanning header.
Optional. Title for the spanning header. If NULL, uses the variable label or name.
Title for the entire table.
A gtsummary table object with updated headers, spanning header, and caption.