I do hope that this question is not "homework". In addition, you will get better help more quickly in this forum if you at least post some R reproducible code that you have tried.
This code does the sort of operation you described, and the same logic will work for sampling the rows of a data frame (e.g. one imported from an external database).
aa <- rnorm(n=20, mean=10) # Some dummy data to sample from
start <- 4
step <- 2
freq <- 3
end <- (step*freq-1)+start
sample_positions <- seq(from=start, to=end, by=step)