One function replaces five. Stop chaining
add_overall(),add_p(),bold_labels(),bold_p(), andmodify_header()on every table.
sumExtras reduces the repetitive boilerplate in gtsummary workflows. Instead of chaining add_overall(), add_p(), bold_labels(), and modify_header() on every table, call extras() once. The package also handles missing value cleanup, automatic variable labeling from data dictionaries, group header styling, and JAMA compact theming.
install.packages("sumExtras")# install.packages("pak")
pak::pak("kyleGrealis/sumExtras")|
Standard gtsummary trial |>
tbl_summary(by = trt) |>
add_overall() |>
add_p() |>
bold_labels() |>
bold_p() |>
modify_header(label = "") |
With sumExtras trial |>
tbl_summary(by = trt) |>
extras() |
extras() also standardizes missing values via clean_table() -- something you'd have to build yourself otherwise.
library(sumExtras)
library(gtsummary)
use_jama_theme()
trial |>
tbl_summary(by = trt) |>
extras()That single extras() call adds the overall column, p-values, bold labels, bold significant p-values, a clean header, and standardized missing value display.
extras()-- overall column, p-values (bolded), bold labels, clean stylingclean_table()-- standardize missing value displayadd_auto_labels()-- automatic labeling from dictionaries or data attributesuse_jama_theme()/theme_gt_compact()-- JAMA compact themesadd_group_styling()-- bold/italic formatting for group headersadd_group_colors()-- background colors for group headers (converts to gt)get_group_rows()-- extract group header row indices
sumExtras = "SUMmary table EXTRAS" + "SOME EXTRAS for gtSUMMARY"
vignette("sumExtras-intro")-- getting startedvignette("labeling")-- dictionary-based labelingvignette("themes")-- JAMA themes for gtsummary and gtvignette("styling")-- group headers and advanced formattingvignette("options")-- .Rprofile options for auto-labeling- Bug reports & feature requests
Bug reports, feature requests, and feedback are welcome at https://github.com/kyleGrealis/sumExtras/issues.
sumExtras adds some extras to your summary tables!
