stat_err | R Documentation |
stat_err
draws intervals of points (x
, y
) in vertical (ymin
, ymax
)
and horizontal (xmin
, xmax
) directions.
stat_err(
mapping = NULL,
data = NULL,
geom = "segment",
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. There are three options: If A A |
geom |
The geometric object to use to display the data, either as a
|
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
Other arguments passed on to |
stat_err()
understands the following aesthetics (required aesthetics are in
bold):
x
xmin
xmax
y
ymin
ymax
alpha
color
group
linetype
linewidth
library(ggplot2)
x <- 1:3
xmin <- x - 2.5
xmax <- x + 2.5
d <- data.frame(
x = x, y = x, xmin = xmin, ymin = xmin, xmax = xmax, ymax = xmax,
color = as.factor(x)
)
ggplot(
d,
aes(x = x, y = y, xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, color = color)
) +
stat_err(size = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.