Have a look at ?png.
Basically you just put the plot command between
png("some.file.name.png")
dev()
Here is a quick example using "ggplot2"
library(ggplot2)
dat1 <- data.frame(xx = 1:5, yy = 5:1)
png("myplot.png")
ggplot(dat1, aes(xx, yy)) + geom_point() +
ggtitle("A plot")
dev.off()
Run this and you should get a file , myplot.png in your working directory.
I think you want performance::check_model(m1) in there but I am not familiar with the package.