Add a boxplot figure to the chart.
fig_boxplot(g, ..., sync = TRUE, data = NULL, inherit_asp = TRUE)
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
|
# wide to long # tidyr::pivot_longer(iris, -Species) df <- reshape( iris, varying = names(iris)[1:4], direction = "long", v.names = "value", idvar = "Species", new.row.names = 1:600, timevar = "var", times = names(iris)[1:4] ) g2(df, asp(var, value, color = Species)) %>% fig_boxplot(adjust("dodge")) g2(iris, asp(y = Sepal.Length, color = Species)) %>% fig_boxplot(adjust("dodge")) g2(iris, asp(x = Species, y = Sepal.Length, color = Species)) %>% fig_boxplot(adjust("dodge"))