Week 14: Iteration, purrr, and wrap-up
Lectures
Labs
- Lab 14: Vectors and Iteration(PDF)
- Lab 14 solutions (password)
- Functional Programming with purrr: 20 Examples >(PDF)
Additional readings
- purrr cheat sheet
- R for Data Science: Iteration
- R for Data Science: A field guide to base R
- Jenny Bryan’s purrr tutorial
- What They Forgot to Teach You About R: Debugging R code
Discussion
- When is a
forloop clearer thanpurrr::map(), and when is it the other way around? - What does it mean for a vector to be atomic, and why does that matter when dates and numbers land in one column?