← Back to all sparks
G

gtsummary

ANALYTICS
Velocity0.0

Presentation-Ready Data Summary and Analytic Result Tables

gtsummary is quietly rebuilding itself around analysis results data, one table verb at a time.

clinical-tablesanalysis-results-dataregression-summariesreproducible-reportingr-package
Current state
gtsummary builds publication-ready summary, regression and survival tables for clinical and epidemiological work. Across this window it has grown in two directions at once: table composition primitives — splitting tables by rows and columns, stacking with labeled IDs, nested strata stacks, flexible merge columns — and a steadily deepening ARD layer, where tbl_ard_* functions, gather_ard() and the hierarchical table family expose the underlying analysis results data as a first-class object.
Where it's heading
The ARD work is the through-line. Table IDs exist so gather_ard() can return a named list; hierarchical tables gained per-level sorting and targeted filtering; ARD inputs are pre-processed so sorting applies to non-standard shapes. The package is becoming a structured-results engine that happens to render tables, rather than a renderer alone. Alongside that, 2.2.0 restored data pre-processing that 2.0 had removed after the reduced functionality hurt users — a maintainer willing to reverse a major-version decision.
Prediction
Expect the hierarchical and ARD functions, introduced as a preview without a full deprecation cycle, to keep stabilizing toward a settled API rather than new table types appearing.

Recent moves

  1. 2mo ago

    Theme elements no longer evaluated by default

    Theme elements stop being evaluated unless they are one of the four addl_cmds slots that legitimately carry expressions — a tightening of what a theme can execute. style_number() gets faster at the cost of a small set of rounded values changing, which is the kind of detail that matters when tables are checked against prior output.

    View source ↗
  2. 8mo ago

    ARD strata functions and finer theme control

    tlb_ard_strata() and its variant extend the ARD surface, head() and tail() methods make gtsummary objects behave more like ordinary data, and several new theme elements move defaults for summary type, overall columns and confidence intervals under user control. A kapa.ai chat bot is added to the documentation site, not the package.

    View source ↗
  3. 11mo ago

    Per-level hierarchical sorting and labeled stacking

    sort_hierarchical() is refactored to allow different sorting methods at each hierarchy level, and filter_hierarchical() gains targeted variable filtering. tbl_stack(tbl_id_lbls) labels which rows came from which input table — plumbing that makes stacked output traceable back to its sources.

    View source ↗
  4. 1y ago

    Table splitting, ID labeling, and add_difference_row

    Tables can now be split horizontally and vertically, merged and stacked inputs can be named so gather_ard() returns a keyed list, and add_difference_row() places differences below the statistics rather than beside them. Users also gain the ability to override the percentage denominator outright.

    View source ↗
  5. 1y ago

    Data pre-processing restored after the 2.0 removal

    A reversal worth noting: pre-processing for add_p() and add_difference() was removed in 2.0 and is brought back here because the reduced functionality was hurting users, particularly for dichotomous differences. modify_post_fmt_fun() adds a formatting pass after the primary one, and the remove_* family switches to clearing everything by default.

    View source ↗
  6. 1y ago

    tbl_merge gains explicit merge columns

    The merge_vars argument makes merge columns explicit, which is what enables hierarchical and hierarchical-count tables to be merged at all. It comes with a deliberate behavior change: mismatched labels for the same variable are no longer silently reconciled to the first one, trading an edge-case convenience for predictability.

    View source ↗