shift: Shift a time series object

View source: R/all_generic.R

shiftR Documentation

Shift a time series object

Description

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.

Usage

shift(x, ...)

Arguments

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.

Value

An object of the same class as the input, shifted by the specified amount.

Examples

## 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)


bbuchsbaum/fmrireg documentation built on May 16, 2023, 10:56 a.m.