R - Repeat

> Procedural Languages > R

2 - Syntax

repeat {
    # Statement
    if(condition) break
}

3 - Example

i=0
repeat {
    print("Hello World")
    i=1+i
    if(i>=3) break
}
[1] "Hello World"
[1] "Hello World"
[1] "Hello World"
Advertising