gtsummary
Presentation-Ready Data Summary and Analytic Result Tables
gtsummary is quietly rebuilding itself around analysis results data, one table verb at a time.
◆Recent moves
- 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 ↗ - 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 ↗ - 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 ↗ - 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 ↗ - 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 ↗ - 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 ↗