New Features and Functions
-
Added function
modify_post_fmt_fun()
to perform formatting on cells after the primary formatting function has been applied. The functionality is similar togt::text_transform()
. (#2014) -
Data pre-processing has now been re-introduced for calculations in
add_p()
andadd_difference()
. Data pre-processing steps were removed in the v2.0 release; however, in some cases---particularlyadd_difference()
for dichotomous variables---the reduced functionality was affecting the user experience. See?tests
for details on data pre-processing. (#2165) -
The
add_variable_group_header()
function has been generalized to work with any gtsummary table, where previously only'tbl_summary'
were accepted. (#2197) -
The footnote placed on the p-value column by
add_significance_stars()
no longer replaces any existing footnote. Rather the footnote is added to any existing footnote. (#2184) -
The
remove_*()
family of functions default argument values have been updated to remove all footnotes, source notes, abbreviations, column merging, bold and italic styling by default, so the users are not longer required to remove, for example, one source note at a time. The one exception isremove_spanning_headers()
, which will remove the first level spanning headers be default. (#2161) -
Added a new theme element
tbl_svysummary-arg:missing_stat
-
Added functions
sort_hierarchical()
andfilter_hierarchical()
to sort and filter hierarchical tables. (#2096)
Bug Fixes
-
Fixed a bug in
tbl_hierarchical()
where thegroup*
variables of the resultingtable_body
were not fully populated. (#2192) -
Corrected bug causing an error in
tbl_hierarchical()
when more than oneby
variable level had been filtered out of the data. (#2173) -
Corrected the class of objects returned from
tbl_strata_nested_stack()
. -
Corrected bug in
tbl_strata_nested_stack()
when the strata variable had a single level. Previously, the indentation of the single strata level was not correct. -
Fix in
tbl_strata_nested_stack()
when there are unobserved combinations of strata levels. (#2179) -
Fixed bug in
tbl_cross()
when a column was named'missing'
. (#2182) -
Fix in theme element
tbl_summary-arg:missing_stat
that was not being applied. (#2176) -
Corrected bug in
tbl_likert()
where variables in table always appeared in alphabetical order. (#2195) -
Corrected bug in
add_n.tbl_likert()
where the Ns were not formatted withstyle_number()
. (#2195)