To select every nth element from any starting position in the vector
nth_element <- function(vector, starting_position, n) {
vector[seq(starting_position, length(vector), n)]
}
# E.g.
vec <- 1:12
nth_element(vec, 1, 3)
# [1] 1 4 7 10
nth_element(vec, 2, 3)
# [1] 2 5 8 11