R - While

> Procedural Languages > R

1 - About

while execute a loop while a condition is true

Advertising

3 - Example

count = 0
while(count < 5) {
   print("Hello World")
   count = count + 1
}
[1] "Hello World"
[1] "Hello World"
[1] "Hello World"
[1] "Hello World"
[1] "Hello World"
[1] "Hello World"