shift | R Documentation |
This is a generic function to shift time series objects. The goal is to provide a simple way to apply time shifts to various time series objects, such as regressors and time series data.
shift(x, ...)
x |
An object representing a time series or a time-based data structure. |
shift_amount |
A numeric value indicating the amount of time to shift the object by. Positive values will shift the object to the right, while negative values will shift it to the left. |
An object of the same class as the input, shifted by the specified amount.
## Not run:
# Shift a regressor object
shifted_regressor <- shift(my_regressor, 5)
# Shift a time series object
shifted_time_series <- shift(my_time_series, -2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.