shifter | R Documentation |
Shifts vector by cyclic permutation
shifter(vec, n = 1L)
vec |
vector to cycle |
n |
amount of cyclic permutation |
shifted vector
https://stackoverflow.com/questions/30542128/ circular-shifting-arrays-in-r-by-distance-n
shifter(1:5, 2)
shifter(1:5, -2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.