NEW FEATURES
-
ggbarstats()(andgrouped_ggbarstats()) now supports one-sample
goodness-of-fit tests when onlyxis specified (withy = NULLas the new
default). This produces a single stacked bar chart with chi-squared GOF test
results in the subtitle, mirroring the existing one-sample support in
ggpiestats()(#532, #697). -
ggpiestats()andggbarstats()now compute pairwise contingency table
analyses (Fisher's exact tests viapairwise_contingency_table()) whenx
has more than two levels. These are available via
extract_stats(plot)$pairwise_comparisons_data. A newp.adjust.method
parameter controls the p-value adjustment method (default:"holm").
Pairwise results are not displayed on the plots since bar and pie charts lack
a natural visual representation for pairwise significance annotations (#554). -
ggscatterstats()now sets a default number of bins for marginal
histograms, suppressing thestat_bin()message about picking a better
binwidth (#810). -
ggscatterstats()gainsxsidehistogram.scaleandysidehistogram.scale
parameters to control the scale (e.g.,breaks,limits,transform) of
the marginal distribution histograms (#898). -
All top-level plotting functions now include an
alternativeargument, which
is passed down to{statsExpressions}to specify the alternative hypothesis for
effect size confidence intervals (#794). -
ggbetweenstats()andggwithinstats()now include apairwise.alpha
argument to control the alpha cutoff used for filtering displayed pairwise
comparisons, and the secondary-axis label now reports the chosenalpha.
BREAKING CHANGES
-
The following expert-level statistical parameters have been removed from all
function signatures because their defaults are the universally recommended
values and changing them requires specialist knowledge (#1087):var.equal(fromggbetweenstats()): Welch's test (var.equal = FALSE)
is uniformly recommended over Student's t-test.nboot(fromggbetweenstats(),ggwithinstats()): 100 bootstrap
resamples is adequate for trimmed-mean CIs.sampling.plan,fixed.margin,prior.concentration(from
ggpiestats(),ggbarstats()): Technical BayesFactor settings that
virtually no one changes.effsize.type(fromggbetweenstats(),ggwithinstats(),
gghistostats(),ggdotplotstats()): The unbiased effect size estimator
is now always used.
Users who need non-default values for these parameters should call
{statsExpressions}directly. -
ggwithinstats()(andgrouped_ggwithinstats()) gains asubject.id
parameter. When provided, the subject identifier column is used to correctly
pair observations across conditions and to remove NA observations by subject
key rather than by positional row number. Plots and statistical results for
unsorted repeated-measures data will differ from previous versions once
subject.idis supplied. All examples and vignettes have been updated to
passsubject.idexplicitly, which is now the recommended practice. -
The
packageargument has been removed from all plotting functions. The
paletteargument now accepts a single"package::palette"string (e.g.,
palette = "ggthemes::gdoc"), matching the convention used by
{paletteer}itself. -
The default
palettehas been changed from"RColorBrewer::Dark2"(8
colors) to"ggthemes::gdoc"(24 qualitative colors), which accommodates
categorical variables with up to 24 levels without errors (#1015). -
When the chosen palette does not have enough colors for the number of levels
in the data, an error is now thrown (previously a warning was issued that
was silently ignored until ggplot2 crashed anyway).
BUG FIXES
-
Grouped plot functions (e.g.,
grouped_ggbarstats()) now preserve the order
of groups as they appear in the data rather than sorting them alphabetically
(#792). -
combine_plots()now renders the overall annotation title in bold by
default, matching the styling used for individual plot titles. -
grouped_ggbarstats()andgrouped_ggpiestats()now display a single
unified legend when different groups have different observed factor levels for
thexvariable. Previously,patchworkcould not merge the per-panel fill
scales, producing duplicate legends (#868). -
ggbetweenstats()andggwithinstats()now correctly display sample size
labels on the x-axis even whencentrality.plotting = FALSE(#695). -
ggcoefstats()now preserves the model term order in the default top-to-bottom
plot layout and in estimate-sorted displays, instead of showing terms in the
reverse order (#642). -
ggcoefstats()no longer draws emptystats.labelsboxes for model terms
whose label expression is absent, which affected mixed-model coefficient
plots such as the documentedlmer()example.