26.4 For loops vs. functionals

For loops are not as important in R as they are in other languages because R is a functional programming language.

This means that it’s possible to put for loops in a function, and call that function instead of using the for loop directly.

Base R and the purrr package have functions for many common loops.