Chapter 13 Iteration

This chapter concludes the part on programming.

Having learned to write our own functions and to use conditionals for disinguishing cases, we will learn how to use iteration (or loops) to execude code repeatedly.


Recommended background readings for this chapter include:


i2ds: Preflexions

To reflect upon the notion and uses of iteration, try answering the following questions:

  • What does the word iteration mean?

  • Why and when do we want to execute code repeatedly?

  • What other means of repeating code do we have?


Neth, H. (2022a). Data science for psychologists. Social Psychology; Decision Sciences, University of Konstanz.
Wickham, H., & Grolemund, G. (2017). R for data science: Import, tidy, transform, visualize, and model data. O’Reilly Media, Inc.