if (requireNamespace("collapse", quietly = TRUE) && requireNamespace("ggplot2", quietly = TRUE)) {
ex124_plot <-
ex124 |>
collapse::fmutate(herd = factor(herd))
ggplot2::ggplot(
ex124_plot,
ggplot2::aes(x = herd, y = PCVdif, shape = dose, color = drug)
) +
ggplot2::geom_point(size = 2.4, position = ggplot2::position_jitter(width = 0.08)) +
ggplot2::facet_wrap(~ drug, nrow = 1) +
ggplot2::labs(
x = "Herd",
y = "Change in packed cell volume",
shape = "Dose",
color = "Drug",
title = "Packed cell volume response by herd, drug, and dose"
) +
ggplot2::theme_minimal()
}