how break for loop in r code example Example: how to break from for loop in r for (i in 1:10){ ifelse(i >= 5, break) }