I use facet_wrap
to every group plot,
but I need to save every plot individual and find the under link.
I tried program the answer in the URL link and can save PDFfile, but present the ERROR MASSAGE.
CODE:
iris %>% group_by(Species) %>%
do({
p <- ggplot(., aes(x =Sepal.Length, y = Petal.Length)) + geom_point()
ggsave(p, filename = paste0("fig/", unique(.$Species), ".pdf"))
})
ERROR MESSAGE:
Results are not data frames at positions: 1, 2, 3