gtsummary 1.5.0
New Functions
-
Added new function
tbl_continuous()
to summarize a continuous variable by 1 or more categorical variables. -
Added new function
add_ci()
that adds a new column with the confidence interval for proportions/means reported intbl_summary()
. (#868) -
Migrated a new function
tbl_split()
from the {bstfun} package. Function allows users to split a {gtsummary} table into multiple tables. -
Migrated a new function
separate_p_footnotes()
from the {bstfun} package. Function allows users to separate the composite footnote listing the tests performed inadd_p()
, and replaces it with individual footnotes for each test name. -
New function
tbl_custom_summary()
allowing to create a table of summary statistics using a custom summary function (#973, #976)- Set of helpers to be used with
tbl_custom_summary()
:continuous_summary()
,proportion_summary()
,ratio_summary()
- Set of helpers to be used with
-
New function
modify_cols_merge()
that can merge two or more columns in a {gtsummary} table. (#939) -
Added function
tbl_butcher()
to reduce the size of a {gtsummary} table. After an object has been butchered, other {gtsummary} functions may not be able to execute on the object. -
Added new function
tidy_robust()
that will add robust standard errors, confidence intervals, and p-values withtbl_regression()
andtbl_uvregression()
. The function is a wrapper forparameters::model_paramters()
. (#979)
New Functionality
-
Added a
CITATION
file so users can now cite the R Journal manuscript usingcitation("gtsummary")
. -
Added Standardized Mean Difference method to
add_difference()
, wrapping the {smd} package's calculations. (#966) -
Extended
add_difference()
to accepttbl_svysummary()
objects in addition totbl_summary()
objects. -
Added a standardized mean difference method for
tbl_svysummary()
tables. -
Added
tbl_strata(.stack_group_header=)
argument to include/exclude the headers when tables are combined withtbl_stack()
-
Added
tbl_strata(.quiet=)
argument. -
Allow
add_p()
andadd_difference()
to be run on the same table. (#959) -
Updated
add_overall()
to include the overall statistics in thedf_stats
tibbles saved in.$meta_data.
This makes it possible to report any of the overall statistics using theinline_text(pattern=)
argument.
Other Updates
-
Added a help file detailing the formula list notation used throughout the {gtsummary} package. (#981)
-
Updates to
tbl_regression()
documentation. The model N is no longer reported by default, and removed that section from the help file. (#998) -
Updates to make the internal
df_stats
objects consistent across various {gtsummary} objects. Added internal functiondf_stats_to_table_body
that adds the numeric df_stats tibble to.$table_body
. The formatting functions are also added for the new columns to.$table_styling$fmt_fun
. This function is now used ininline_text.gtsummary()
to prepare the returned statistics (#921) -
Now using
broom::tidy()
to prepare thecar::Anova()
results. This will be more stable than the version originally written. (#898) -
The function
assert_package()
now takes the minimum required version of the package from the DESCRIPTION file, and the function is now exported. -
Now using
broom::tidy()
to prepareaov()
test results inadd_p.tbl_summary()
, which adds additional columns to.$table_body()
(#956) -
Updated the
README
to include links to a recording of a gtsummary presentation and to the RStudio Education blog post. -
Removed
maturing
lifecycle tag fromREADME
. -
Updated deprecated function
workflows::pull_workflow_fit(x)
toworkflows::extract_fit_parsnip(x)
.
Bug Fixes
-
Fix in
tbl_summary()
when a factor variable is passed that is allNA
with no specified levels. (#977) -
Fix in
add_p.tbl_summary()
when a factor variable with all NA values is passed. (#977) -
Bug fix for the
add_difference(estimate_fun=)
argument.
Breaking Changes
-
Updated
add_p.tbl_summary(test = . ~ "mcnemar.test", group = id)
syntax to require thegroup=
argument to align with the paired Wilcoxon rank-sum test and paired t-test syntax. -
Deleted deprecated functions
add_comparison()
,add_global()
,tab_style_bold_p()
,tab_style_bold_labels()
,tab_style_italicize_levels()
,tab_style_italicize_labels()
,tab_style_bold_levels()
. -
The following deprecated arguments have been removed:
tbl_summary(group=)
,as_gt(omit=)
. -
The survival package has been moved from Imports to Suggests, and will no longer automatically be installed when {gtsummary} is installed. Additionally,
survival::Surv()
is no longer re-exported with the package.