shift: Permute elements of a vector in a cycle

shiftR Documentation

Permute elements of a vector in a cycle

Description

Given a vector, permute the elements with a cyclic permutation

Usage

shift(x,i=1)

Arguments

x

Vector

i

Integer, number of places to permute. Negative values mean to count from the end

Details

This function is that of the magic package, where it is motivated and discussed.

Value

Returns a vector

Author(s)

Robin K. S. Hankin

Examples


shift(1:9)
shift(1:9,-1)

shift(1:9,2)



RobinHankin/freegroup documentation built on March 11, 2024, 12:32 a.m.