This will help us to control the flow of the R program. It is very much similar to other type of programming language’s Control Structure. Lets look into some common ones,
- For loops
- Nested for loops
- While Loops
- Repeat Loops and break
A for loop will help to iterate through iterable objects.
Repeat Loops and break
The repeat loop initiates an infinite loop. Like in other programming language if we want to stop the loop we should use break.
next is used to skip an iteration of a loop.