R: Shift function

shift {binhf} | R Documentation

## Shift function

### Description

This function shifts a vector input a certain number of places in the direction desired.

### Usage

    shift(v, places, dir = "right")

### Arguments

`v` | a vector of input values.
`places` | the number of places to shift v.
`dir` | The direction to shift v.

### Details

The function shifts the vector v by places in the direction of direction, using wrapping at the boundaries. Used for cycle spinning.

### Value

`vnew` | the shifted version of v.

### Author(s)

Matt Nunes (m.nunes@ucl.ac.uk)

### Examples

    v<-runif(10)

    #have a look at v:

    v

    #now shift the values 4 places to the right...

    shift(v,4,dir="right")

[Package binhf version 1.0-1 Index]