10) Iterations
📖 Iterations and Loops
This week we introduce the syntax used by R to handle iteration constructs such as for loops and while loops, among other idioms.
📰 Slides
🎯 Objectives
At the end of this week you will be able to:
- Describe the anatomy of a
forloop in R - Describe the anatomy of a
whileloop in R - Describe the anatomy of a
repeatloop in R - Get familiar with the
nextstatement to skip iterations - Get familiar with the
breakstatement to stop loops from iterating - Provide examples for
apply(),lapply(),sapply()functions - Provide an example of the “dplyr” function
across()