Walk
the map
set of functions return function values,
you use walk
if you are only interested in the function side effects.
E.g., saving out to a file.
x <- list(1, "a", 3)
x %>%
walk(print)
## [1] 1
## [1] "a"
## [1] 3
list of plots with file names, you can use pwalk to save
library(ggplot2)
plots <- mtcars %>%
split(.$cyl) %>%
map(~ggplot(., aes(mpg, wt)) + geom_point())
paths <- stringr::str_c(names(plots), ".pdf")
# pwalk(list(paths, plots), ggsave, path = tempdir())