Closed Crismoc closed 2 months ago
No, this is not possible. But these figures are absolutely trivial to draw once we have the proper dataset. And you can get the dataset by using draw=FALSE
. After that, it should be no more than 3 lines of ggplot2
to get exactly what you want.
Thank you! You're right, it's possible to do it in one line relying on ggplot and finding the right name for the panels
library(ggplot2)
library(marginaleffects)
dat <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/palmerpenguins/penguins.csv")
mod <- lm(body_mass_g ~ flipper_length_mm * species * bill_length_mm + island, data = dat)
plot_comparisons(mod,
variables = c("flipper_length_mm", "bill_length_mm"),
by = c("species", "island")) +
facet_wrap(~term, ncol = 1)
When printing multiple plots with
plot_*
, is it possible to add a simple way to choose how many columns or rows the figure should have?I imagine something like the code below, but making it possible to specify the rows or columns like this
plot_comparisons(..., ncol = 1)