| grouped_gghistostats | R Documentation |
Helper function for ggstatsplot::gghistostats() to apply this function
across multiple levels of a given factor and combining the resulting plots
using ggstatsplot::combine_plots().
grouped_gghistostats(
data,
x,
grouping.var,
binwidth = NULL,
plotgrid.args = list(),
annotation.args = list(),
...
)
data |
A data frame (or a tibble) from which variables specified are to
be taken. Other data types (e.g., matrix, table, array, etc.) will not
be accepted. Additionally, grouped data frames from |
x |
A numeric variable from the data frame |
grouping.var |
A single grouping variable. A separate plot is created for each of its levels (in factor level order, or in order of appearance for character variables). Rows with a missing value in this variable are removed. |
binwidth |
The width of the histogram bins (see |
plotgrid.args |
A |
annotation.args |
A |
... |
Arguments passed on to
|
Missing values in x are removed before plotting and analysis.
For details, see: https://www.indrapatil.com/ggstatsplot/articles/web_only/gghistostats.html
A patchwork object combining one plot per level of
grouping.var (see combine_plots()). Applying extract_stats() to
it returns a list with the statistical details for each of these plots.
gghistostats, ggdotplotstats,
grouped_ggdotplotstats
# for reproducibility
set.seed(123)
# plot
grouped_gghistostats(
data = iris,
x = Sepal.Length,
test.value = 5,
grouping.var = Species,
plotgrid.args = list(nrow = 1),
annotation.args = list(tag_levels = "i")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.