Skip to content

Extra Functions for {gtsummary} Table Styling: Provides additional convenience functions for {gtsummary} & {gt} tables, including automatic variable labeling from dictionaries, standardized missing value display, and consistent formatting helpers for streamlined table styling workflows.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

kyleGrealis/sumExtras

Repository files navigation

sumExtras

R-CMD-check CRAN status CRAN downloads Lifecycle: stable

One function replaces five. Stop chaining add_overall(), add_p(), bold_labels(), bold_p(), and modify_header() on every table.

Overview

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.

Installation

CRAN

install.packages("sumExtras")

Development version

# install.packages("pak")
pak::pak("kyleGrealis/sumExtras")

See the Difference

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.

Quick Start

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.

Functions

  • extras() -- overall column, p-values (bolded), bold labels, clean styling
  • clean_table() -- standardize missing value display
  • add_auto_labels() -- automatic labeling from dictionaries or data attributes
  • use_jama_theme() / theme_gt_compact() -- JAMA compact themes
  • add_group_styling() -- bold/italic formatting for group headers
  • add_group_colors() -- background colors for group headers (converts to gt)
  • get_group_rows() -- extract group header row indices

The Name

sumExtras = "SUMmary table EXTRAS" + "SOME EXTRAS for gtSUMMARY"

More Info

Full documentation

  • vignette("sumExtras-intro") -- getting started
  • vignette("labeling") -- dictionary-based labeling
  • vignette("themes") -- JAMA themes for gtsummary and gt
  • vignette("styling") -- group headers and advanced formatting
  • vignette("options") -- .Rprofile options for auto-labeling
  • Bug reports & feature requests

Contributing

Bug reports, feature requests, and feedback are welcome at https://github.com/kyleGrealis/sumExtras/issues.

License

MIT


sumExtras adds some extras to your summary tables!

About

Extra Functions for {gtsummary} Table Styling: Provides additional convenience functions for {gtsummary} & {gt} tables, including automatic variable labeling from dictionaries, standardized missing value display, and consistent formatting helpers for streamlined table styling workflows.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages