shift {freegroup}R 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)



[Package freegroup version 1.1-8 Index]