Iterating well with purrr

An R-Ladies workshop

Shannon Pileggi true
on gray background: purrr::map(.x, .f, ...) for every element of .x do .f

Figure 1: Slide from the workshop.



A zoom workshop on iterating well with purrr for R-Ladies Rabat.

Under the Creative Commons Share Alike 4.0 International license, workshop materials have been adapted from the 2020 RStudio What They Forgot To Teach You About R Workshop.


In this workshop we discuss approaches to iteration in R. We briefly discuss iterative techniques that do not require loops or purrr::map_ (for example, group_by, vectorized functions, etc.). Then we explore lists as an object to store information of varying types and sizes and explain how to extract elements from a list via the purrr::map_ family.


For attribution, please cite this work as

Pileggi (2022, June 8). PIPING HOT DATA: Iterating well with purrr. Retrieved from

BibTeX citation

  author = {Pileggi, Shannon},
  title = {PIPING HOT DATA: Iterating well with purrr},
  url = {},
  year = {2022}