Let I have an array like
a <- seq(1, 100, 1)
and I want to select just the elements that occur each 3 steps with a for() loop starting from the second one, e.g. 2, 5, 8, 11 and so on.
How should I use for() in this case?
b <- NULL
# for(i in 1:length(a)) { # Is there any additional argument?
# b[i] <- a[...] # Or I can just multiply 'i' by some integer?
# }
Thanks,
Use
3as the value forbyinseq