| StatDistMean | R Documentation |
StatDistMean receives the rows that ggplot2 has assigned to each panel and
emits their mean as an xintercept. Because ggplot2 transforms position
scales and applies hard-limit out-of-bounds handling before a stat runs, the
result follows that lifecycle: a transformed scale changes the values being
averaged, hard scale limits can remove values, and coordinate zoom does not
change the result.
StatDistMean
stat_dist_mean(
mapping = NULL,
data = NULL,
geom = "vline",
position = "identity",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. |
geom |
The geometric object used to display the data. Defaults to
|
position |
A position adjustment. Defaults to |
... |
Other arguments passed to |
na.rm |
If |
show.legend |
Logical. Should this layer be included in the legends? |
inherit.aes |
If |
StatDistMean is a ggplot2::Stat object.
stat_dist_mean() is the conventional layer constructor. It computes from
x and defaults to a vertical line; show_mean() is the teaching-oriented
helper that resolves a distribution plot's mapping and styles this layer.
Since the stat computes once per panel, styling aesthetics from the source
data cannot be mapped; set them to one value, or facet the plot to compute
one mean per group.
stat_dist_mean() returns a ggplot2 layer.
show_mean() and gf_model().
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.