| StatCutoff | R Documentation |
StatCutoff calls the same cutoff_plan() used by show_cutoffs(), but the
two interfaces deliberately operate at different scopes. ggplot2 supplies a
stat with one panel's rows at a time, so this stat computes panel-local
cutoffs. show_cutoffs() plans once from the whole resolved distribution and
repeats those global marks across facets.
StatCutoff
stat_cutoff(
mapping = NULL,
data = NULL,
geom = "cutoff",
position = "identity",
...,
part = "middle",
prop = 0.95,
greedy = TRUE,
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 |
part |
The distribution part to mark: |
prop |
The requested proportion. The endpoints |
greedy |
Whether a fractional observation is included in the selected region. |
na.rm |
If |
show.legend |
Logical. Should this layer be included in the legends? |
inherit.aes |
If |
StatCutoff is a ggplot2::Stat object.
The stat accepts "middle", "tails", "upper", "lower", and
"outer". It selects cutoffs in the data's original space: transformed
position values are inverted before cutoff_plan() runs, and the selected
cutoffs are transformed forward again for ggplot2. This preserves the
requested distribution part on increasing, decreasing, and transformed
scales.
stat_cutoff() is the conventional layer constructor. Its default geom is
"cutoff"; use geom = "vline" when a full-height reference line is
wanted instead. 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 set of cutoffs per group.
stat_cutoff() returns a ggplot2 layer.
show_cutoffs(), which marks whole-distribution cutoffs.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.