plot_stackedbar {daltoolbox} | R Documentation |
plot stacked bar
Description
plot stacked bar
Usage
plot_stackedbar(data, label_x = "", label_y = "", colors = NULL, alpha = 1)
Arguments
data |
data.frame contain x, value, and variable |
label_x |
x-axis label |
label_y |
y-axis label |
colors |
color vector |
alpha |
level of transparency |
Value
ggplot graphic
Examples
data <- iris |> dplyr::group_by(Species) |>
dplyr::summarize(Sepal.Length=mean(Sepal.Length), Sepal.Width=mean(Sepal.Width))
grf <- plot_stackedbar(data, colors=c("blue", "red"))
plot(grf)
[Package daltoolbox version 1.0.767 Index]