shift.vec {imagefx} | R Documentation |
Shift a vector to the left or right by a certain amount (i.e. perform a simple phase shift).
shift.vec(shift, vec)
shift |
Amount of samples to shift vector in either the positive or negative direction. |
vec |
Vector to shift. |
The shift is accomplished by padding the head or tail of the vector with NA
values.
Shifted vector.
Alex J.C. Witsil
## generate a delta function
vec=rep(0,5)
vec[3] = 1
## shift vector by -2
new.vec = shift.vec(-2,vec)