shift: Shift function

Description Usage Arguments Details Value Author(s) Examples

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
9
v<-runif(10)

#have a look at v:

v

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

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


Search within the binhf package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.