
create_time_lags
create_time_lags.Rd
This function creates time-lagged rows in a tibble using the 'time_column' as the reference point. The new rows are filled with NA values and have their time interval shifted by a specified lag duration.
Arguments
- x
A tibble containing the original data.
- n_lag_range
A numeric vector of length 2 defining the range of lag times.
- time_lag
A duration object specifying the size of the time lag.
- lag_amount_units
A duration object or a numeric in seconds that determines the unit for the 'lag_amount' column.
- relative_to_start
A logical value indicating whether the lag should be relative to the start or the end of the input time interval.
- time_column_name
Name of the time column in
x
.