This code returns a list, you can iterate over the list to save individual files, take a look at this example:
library(lme4)
library(ggplot2)
library(ggeffects)
library(magrittr)
#Open my dataset
myds<-read.csv("https://raw.githubusercontent.com/Leprechault/trash/main/my_glmm_dataset.csv",
fileEncoding = 'latin1')
myds <- myds[,-c(3)] # remove bad character variable
# Negative binomial GLMM
m.laden.1 <- glmer.nb(ladenant ~ Bioma + poly(temp,2) + scale(UR) + (1 | formigueiro), data = myds)
# Visualize
plot <- ggpredict(m.laden.1) %>%
plot(add.data = TRUE)
purrr::walk2(plot, names(plot),
.f= ~ ggsave(paste0(.y, ".png"),
plot = .x,
dpi = 300,
width = 15,
height = 15,
units = "cm"))