apply_labels_from_dictionary(). Use
attr(data$var, "label") <- "Label" directly, or the
{labelled} package for bulk attribute labeling.extras() auto-labeling via
options(sumExtras.auto_labels = TRUE) and (recommended)
options(sumExtras.prefer_dictionary = TRUE). See
vignette("options").extras() now bolds significant p-values
(bold_p()) automatically when p-values are added.header parameter in extras() controls
the label column header text (default "").symbol parameter in clean_table() and
extras() controls the missing value replacement string
(default "---").add_group_colors() now accepts a vector of colors (one
per group) in addition to a single color for all groups.variable, description) by convention.
Title-case names (Variable, Description) still
work — column matching is case-insensitive.extras() now handles tbl_regression
gracefully: overall and pval are silently
ignored (regression tables already have model p-values), and
bold_p() is applied automatically. No more warnings when
using extras() with default arguments on regression
tables.{purrr} from Imports (4 dependencies instead of
5).vignette("options") and
vignette("themes").Added quiet = TRUE default to
use_jama_theme() to suppress messages from {gtsummary} and
{sumExtras}. Resolves issue #12 (thank you @RaymondBalise).
extras() no longer warns when called with default
arguments on non-stratified tables. Previously, calling
extras(tbl) on a table without a by argument
would warn even though the user didn’t explicitly request
overall or pval features. Now warnings only
fire when users explicitly request features that can’t
be applied:
extras(non_stratified_tbl) - Silent (applies basic
formatting)extras(non_stratified_tbl, overall = TRUE) - Warns
(user explicitly requested)extras(non_stratified_tbl, pval = TRUE) - Warns (user
explicitly requested).add_p_args argument to extras()
allows for passing gtsummary::add_p() arguments, such as:
test for specifying statistical tests for each variable
(i.e., "t.test", "fisher.test"). Thank you,
Daniel Maya.pvalue_fun for formatting p-valuesgroup, include, etc.?gtsummary::add_p.tbl_summary for more information
of proper usage.NA value recognition used by
clean_table. This fixes the function previously not
recognizing 0 (0) for Mean (SD).group_styling() renamed to
add_group_styling() to follow gtsummary’s
add_*() naming conventionadd_group_colors() function provides a clean,
pipeable way to add background colors to group headers
get_group_rows() and
as_gt() callsadd_group_colors() section to styling vignette
with side-by-side manual vs. convenience pattern comparisonclean_table() now correctly handles additional
percentage formats including 0% (0.000) and
0.00% (0.00), which were previously not being converted to
dashesapply_labels_from_dictionary() improved with clearer
implementation using traditional for-loop instead of confusing
<<- side-effect assignmentstr_detect()
with base R grepl(..., perl = TRUE), reducing package
dependency footprintpurrr::walk2() with traditional for-loop in
apply_labels_from_dictionary() for improved code clarity
and maintainabilitysumExtras-package)
with notes about dependency on gtsummary internal structures and minimum
version requirementsadd_auto_labels() documentation with
implementation notes about gtsummary internalsextras() explaining
why Monte Carlo simulation is usedgrepl() instead
of stringrcreate_labels() has been deprecated and removed. Users
should migrate to add_auto_labels() instead. Migration
example: Instead of
tbl_summary(label = create_labels(data, dict)), use
tbl_summary() |> add_auto_labels(dict).use_jama_theme() function for explicit JAMA
compact theme applicationuse_jama_theme()add_auto_labels() now supports
tbl_regression and tbl_uvregression objects in
addition to tbl_summary objects (55bc540)add_auto_labels() now automatically searches the
calling environment for a dictionary object when no
dictionary is explicitly providedadd_auto_labels() can now read label attributes
directly from data as a fallback when no dictionary is found, so it
works with {haven}, {labelled}, and other packages that set label
attributesadd_auto_labels() uses a fixed label priority: manual
labels (from label = list()) take precedence, then
attribute labels, then dictionary labels, then variable namesapply_labels_from_dictionary() function to set
label attributes on data from a dictionary for use with ggplot2 4.0+,
gt, and other label-aware packagesgroup_styling() gains an indent_labels
parameter (default 0L) to control indentation of variable
labels under group headers. Set to 4L to preserve
gtsummary’s default group indentation behaviorextras() gains a last parameter to control
Overall column position (default FALSE aligns with
gtsummary::add_overall() behavior)extras() gains a .args parameter to accept
a list of arguments, allowing programmatic control of pval,
overall, and last parametersadd_auto_labels() now falls back to label attributes
when no dictionary is found instead of erroringgtsummary::all_tests() in
extras() functionclean_table() to avoid false
positives (e.g., matching "..." or " ")extras() now warns when add_overall() or
add_p() fail instead of silently continuingmodify_indent() column parameter in
group_styling() - column name now properly quoted as
“label” to ensure correct indentation when rendering vignettes in
pkgdownextras() now warns when called with unsupported table
types (tbl_regression, tbl_strata, non-stratified tables) instead of
silently skipping featuresclean_table() handling of tbl_strata
objects by detecting when var_type column is missingadd_auto_labels() to avoid double iteration
when extracting variable names and labelsuse_jama_theme() usage in Quick
Startuse_jama_theme() to function reference listextras() function for one-call gtsummary table
stylingclean_table() for standardized missing value
displayadd_auto_labels() and
create_labels() for automatic variable labelingtheme_gt_compact() for JAMA-style gt table
themesgroup_styling() for group header formatting