shifter: Circularly shift vector elements

Description Usage Arguments Value

View source: R/rtools.R

Description

To e.g. change the position of a peak within a series positive n shifts things to the left, negative to the right

From: http://stackoverflow.com/questions/30542128/circular-shifting-arrays-in-r-by-distance-n

Usage

1
shifter(x, n)

Arguments

x

[1,m] numeric, input data

n

[1,1] ind, number of positions to shift, positive n shifts things to the left, negative to the right

Value

A shifted version of x


jutako/Rtools documentation built on May 29, 2019, 4:52 p.m.