Skip to content
Prev 18146 / 398503 Next

how does while work

On Wed, 20 Mar 2002, jimi adams wrote:

            
If you are trying to jump out of a for loop early then try something like:

for (i in 1:101) {
  i -> x
  if (! x<100 ) { break }
  x -> a
}

the "next" command will also skip the rest of the body of the loop and
start on the next iteration.

Hope this helps,