shift.vec: Shift Vector

Description Usage Arguments Details Value Author(s) Examples

View source: R/shift.vec.r

Description

Shift a vector to the left or right by a certain amount (i.e. perform a simple phase shift).

Usage

1
shift.vec(shift, vec)

Arguments

shift

Amount of samples to shift vector in either the positive or negative direction.

vec

Vector to shift.

Details

The shift is accomplished by padding the head or tail of the vector with NA values.

Value

Shifted vector.

Author(s)

Alex J.C. Witsil

Examples

1
2
3
4
5
6
## generate a delta function
vec=rep(0,5)
vec[3] = 1 

## shift vector by -2
new.vec = shift.vec(-2,vec)

imagefx documentation built on Feb. 14, 2020, 1:07 a.m.