I'd like to save my three 3 plots in *png files, but if I try:
#Packages
library(lme4)
library(ggplot2)
library(ggeffects)
#Open my dataset
myds<-read.csv("https://raw.githubusercontent.com/Leprechault/trash/main/my_glmm_dataset.csv")
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
ggpredict(m.laden.1) %>% plot(add.data = TRUE)
# I have 3 plots for:
# $Bioma
# $temp
# $UR
# Save the plot in a png file
png(filename="example.png", res = 300, width = 15, height = 15, units = "cm")
ggpredict(m.laden.1) %>% plot(add.data = TRUE)
dev.off()
Doesn't work and I have in the file example.png, just the image of the last plot. I'd like the three files, each file with one plot. Please any help with it?