Description Usage Arguments Details Examples
Add an error bar figure to the chart.
1 2 3 4 5 6 7 8 |
g |
An object of class |
... |
Options to pass to the figure, including |
sync |
Whether to sync the axis data (align) with that
used in other figures, set to |
data |
A dataset ( |
inherit_asp |
Whether to inherit the aspects paseed to
|
alias |
Name of the range to display on tooltips, labels, etc. |
Requires the ymin
and ymax
aspects, the
width of the error bars can be changed with the size
aspect.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | df <- data.frame(
x = as.factor(c(1:10, 1:10)),
y = runif(20, 10, 15),
grp = rep(c("A", "B"), each = 2)
)
df$ymin <- df$y - runif(20, 1, 2)
df$ymax <- df$y + runif(20, 1, 2)
g2(df, asp(x = x, color = grp)) %>%
fig_error(asp(ymin = ymin, ymax = ymax), adjust("dodge")) %>%
fig_interval(
asp(y = y),
adjust("dodge"),
fillOpacity = .4
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.