R/loop.R
loop.Rd
Offset a Vector in a Looping Fashion
loop(x, n, margin = c("row", "col"), index, index1 = FALSE)
A vector or a matrix
The number of places to offset
"row" or "col" of a matrix
The row or column number to change
Whether or not the index starts at 0 (FALSE) or 1 (TRUE)
FALSE
TRUE
x, but with the appropriate shifting
x