iris |>
plot_means(Petal.Length, by = Species)
iris |>
plot_means(
dplyr::starts_with("Petal"),
by = Species,
geom = "bar",
fill = "lightblue",
show_overall_line = TRUE
)
# \donttest{
mtcars |>
plot_means(
mpg,
by = c(cyl, gear),
size = 3,
colour = "plum",
flip = TRUE
)
# works with continuous by variables
mtcars |>
plot_means(
mpg,
by = c(disp, drat),
fill = "plum",
geom = "bar",
flip = TRUE,
minimal = TRUE
)
# works with survey object
iris |>
srvyr::as_survey() |>
plot_means(
Petal.Length,
by = c(Species, Petal.Width),
label_y = -1,
size = 3,
mapping = ggplot2::aes(colour = by),
flip = TRUE
)
# }
Run the code above in your browser using DataLab