- A
for
loop repeats a chunk of code many times, once for each element in a set of input.
for (value in that) { this }
- The
that
object should be a set of objects (often a vector of numbers or character strings).1:10
1:length(x)
1:nrow(x)
c("hello", "this", "is", "a", "vector", "of", "strings")