Answer Posted / Anjali Nayak
{"while loop": "Here is a simple example of a while loop in R:
while (x < 10) {n x <- x + 1n print(x)n }","for loop": "A for loop can be used to iterate over a sequence or a vector. Here is an example:
for (i in 1:5) {n print(i * i)n }"
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers