Intro to iteration

Iteration = repeatedly performing the same action on different objects

R is full of hidden iteration!

  • ggplot2::facet_wrap() / ggplot::facet_grid()
  • dplyr::group_by() + dplyr::summarize()
  • tidyr::unnest_wider() / tidyr::unnest_longer()
  • Anything with a vector!
    • 1:10 + 1 requires loops in other languages!