shift | R Documentation |
The function makes use of the function 'filter' to delay or advance a signal by k points.
shift(x, delta = 1, circular = TRUE)
x |
A numeric vector |
delta |
A single element numeric vector. Defines the number of points by which the signal should be shifted. |
circular |
Logical. If TRUE, the signal is wrapped around itself so that if delta = 1, x[n] becomes x[1]. Otherwise, if delta is positive, the same number of zeros are prepended to the signal |
The function makes use of the function 'filter' for linear filtering to carry out the shifting.
The signal shifted by a certain number of points. ...
Jonathan Harrington
filter
vec = 1:10
shift(vec, 2)
shift(vec, -2)
shift(vec, 2, circular=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.