shift {freegroup} | R Documentation |
Given a vector, permute the elements with a cyclic permutation
shift(x,i=1)
x |
Vector |
i |
Integer, number of places to permute. Negative values mean to count from the end |
This function is that of the magic package, where it is motivated and discussed.
Returns a vector
Robin K. S. Hankin
shift(1:9)
shift(1:9,-1)
shift(1:9,2)