Loop.R
From Organic Design wiki
- ==============================================================================
- Loop evaluation e.g. 6 parts, 4 comparisons
- this function is construting an array e.g. 1,2,3,4,5,6,1,2,3
- and then subsetting sequential arrays of length four from it
- e.g. 1,2,3,4 2,3,4,5 3,4,5,6 etc
- ==============================================================================
start <- 1
loop <- 6
comp <- 4
loops <- 0:(loop+comp-1) %% loop +1
for(i in seq(loop)){
print(loops[seq(from=i, length=comp)])
}