Ответ 1
for(n in 1:5) {
if(n==3) next # skip 3rd iteration and go to next iteration
cat(n)
}
Предположим, что у вас такой цикл for
for(n in 1:5) {
#if(n=3) # skip 3rd iteration and go to next iteration
cat(n)
}
Как пропустить следующую итерацию, если выполняется определенное условие?
for(n in 1:5) {
if(n==3) next # skip 3rd iteration and go to next iteration
cat(n)
}