Learn R Programming

ifultools (version 2.0-26)

rotateVector: Circularly vector rotation

Description

Circularly rotates elements in a vector.

Usage

rotateVector(x, shift=1)

Value

a numeric vector containing the result.

Arguments

x

a vector.

shift

an integer denoting the shift (number of elements to circularly rotate). A negative value implies a negative (leftward) shift of the data.

See Also

isVectorAtomic.

Examples

Run this code
rotateVector(1:5, 2)
rotateVector(1:5, -2)

Run the code above in your browser using DataLab