- for
- in
for loop
examples/other/for.R
for (i in 1:3) { cat(i, end="\n") } start = 30 end = 32 for (i in start:end) { cat(i, end="\n") } animals = c("bear", "rabbit", "dog") for (animal in animals) { cat(animal, end="\n") }
for (i in 1:3) { cat(i, end="\n") } start = 30 end = 32 for (i in start:end) { cat(i, end="\n") } animals = c("bear", "rabbit", "dog") for (animal in animals) { cat(animal, end="\n") }