shift.vec {imagefx}R Documentation

Shift Vector

Description

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

Usage

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


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

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


[Package imagefx version 0.4.1 Index]