R provides two additional looping constructs, while and repeat, which are typically used in situations where the number of iterations required is indeterminate.
The while loop
The general form of a while loop is as follows,
while (condition) {
## do something
## in loop body
}
whe...