How to jump to next top level loop?
问题 I have a for loop nested in another for loop. How can I make it so that when somethign happens in the inner loop, we exit and jump to the next iteration of the outer loop? uuu <- 0 for (i in 1:100) { uuu <- uuu + 1 j <- 1000 for (eee in 1:30) { j <- j - 1 if (j < 990) { # if j is smaller than 990 I hope start next time of i } } } 回答1: @flodel has the correct answer for this, which is to use break rather than next . Unfortunately, the example in that answer would give the same result whichever