R/stat_pointinterval.R
stat_pointinterval.Rd
A combination of stat_sample_slabinterval()
and
geom_slabinterval()
with sensible defaults.
While the corresponding geom
s are intended for use on
data frames that have already been summarized using a point_interval()
function, these stat
s are intended for use directly on data frames of draws, and
will perform the summarization using a point_interval()
function.
stat_pointinterval( mapping = NULL, data = NULL, geom = "pointinterval", position = "identity", ..., orientation = NA, interval_function = NULL, interval_args = list(), point_interval = median_qi, .width = c(0.66, 0.95), show_slab = FALSE, na.rm = FALSE, show.legend = c(size = FALSE), inherit.aes = TRUE, .prob, fun.data, fun.args )
mapping  Set of aesthetic mappings created by 

data  The data to be displayed in this layer. There are three options: If A A 
geom  Use to override the default connection between

position  Position adjustment, either as a string, or the result of a call to a position adjustment function. 
...  Other arguments passed to 
orientation  Whether this geom is drawn horizontally ( 
interval_function  Custom function for generating intervals (for most common use cases the 
interval_args  Additional arguments passed to 
point_interval  A function from the 
.width  The 
show_slab  Should the slab portion of the geom be drawn? Default 
na.rm  If 
show.legend  Should this layer be included in the legends? Default is 
inherit.aes  If 
.prob  Deprecated. Use 
fun.data  Deprecated. Use 
fun.args  Deprecated. Use 
A ggplot2::Stat representing a point+multiple uncertainty interval geometry which can
be added to a ggplot()
object.
These stats support the following aesthetics:
datatype
x
y
thickness
size
group
In addition, in their default configuration (paired with geom_pointinterval()
) the following aesthetics are supported by the underlying geom:
x
y
datatype
alpha
colour
linetype
fill
shape
stroke
point_colour
point_fill
point_alpha
point_size
size
interval_colour
interval_alpha
interval_size
interval_linetype
slab_size
slab_colour
slab_fill
slab_alpha
slab_linetype
ymin
ymax
xmin
xmax
width
height
thickness
group
See examples of some of these aesthetics in action in vignette("slabinterval")
.
Learn more about the subgeom aesthetics (like interval_color
) in the scales documentation.
Learn more about basic ggplot aesthetics in vignette("ggplot2specs")
.
See geom_pointinterval()
for the geom versions, intended
for use on points and intervals that have already been summarized using a point_interval()
function.
See stat_interval()
for a similar stat intended for intervals without
point summaries. See stat_sample_slabinterval()
for a variety of other
stats that combine intervals with densities and CDFs.
See geom_pointinterval()
for the geom versions, intended
for use on points and intervals that have already been summarized using a point_interval()
function.
See stat_interval()
for a similar stat intended for intervals without
point summaries.
See stat_sample_slabinterval()
for a variety of other
stats that combine intervals with densities and CDFs.
See geom_slabinterval()
for the geom that these geoms wrap. All parameters of that geom are
available to these geoms.
library(dplyr) library(ggplot2) data(RankCorr_u_tau, package = "ggdist") RankCorr_u_tau %>% ggplot(aes(y = factor(i), x = u_tau)) + stat_pointinterval(.width = c(.66, .95))