R next Statement
The next statement is used to skip any remaining statements in the loop and continue executing. In simple words, a next statement is a statement which skips the current iteration of a loop without terminating it. When the next statement is encountered, the R parser skips further evaluation and starts the next iteration of the loop.
This statement is mostly used with for loop and while loop.
Note: In else branch of the if-else statement, the next statement can also be used.
There is the following syntax for creating the next statement in R
Example 1: next in repeat loop
Example 2: next in while loop
Example 3: next in for loop