Functions and iteration
Readings
- Chapter 25: Functions of R for Data Science (2e)
- Chapter 26: Iteration of R for Data Science (2e)
Optional readings
- Chapter 27.5:
forloops of R for Data Science (2e)
Guiding questions
- When should you write a function?
- What are some advantages of writing functions relative to copy-and-paste?
- What is conditional execution?
Slides
The slides for today’s lesson are available online as an HTML file. Use the buttons below to open the slides either as an interactive website or as a static PDF (for printing or storing for later).
View all slides in new window Download PDF of all slides
Fun fact: If you type ? (or shift + /) while going through the slides, you can see a list of special slide-specific commands.