next

next
Skip to the next iteration in a loop.

Example. Below a for-loop prints out i for each iteration, except when i is 4 and 5.
> 
> for(i in 1:10){
+   if(i %in% 4:5){
+     next
+   }
+   cat(i, "")
+ }
1 2 3 6 7 8 9 10 
> 

Leave a Reply