ggerrorband | R Documentation |
tf
objects as boundsPlots a shaded region between tf
-objects ymax
and ymin
.
This is primarily intended to help with plotting confidence bands
although other purposes are possible.
stat_errorband(
mapping = NULL,
data = NULL,
geom = "errorband",
position = "identity",
na.rm = TRUE,
show.legend = NA,
inherit.aes = TRUE,
arg = NULL,
...
)
geom_errorband(
mapping = NULL,
data = NULL,
position = "identity",
na.rm = TRUE,
show.legend = NA,
inherit.aes = TRUE,
arg = NULL,
...
)
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 for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
na.rm |
remove NAs? defaults to |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
arg |
where to evaluate |
... |
Other arguments passed on to
|
set.seed(1221)
data <- data.frame(id = factor(1:2))
data$f <- tf_rgp(2)
data$ymax <- data$f + 1
data$ymin <- data$f - 1
library(ggplot2)
ggplot(data, aes(y = f, color = id)) +
geom_spaghetti() +
geom_errorband(aes(ymax = ymax, ymin = ymin, fill = id)) +
facet_wrap(~id)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.