lag_t: Lag Observation Times

Description Usage Arguments Methods (by class) Note See Also Examples

View source: R/lag.R

Description

Compute a lagged version of a time series by shifting observation times. Each observation time is shifted by the same temporal amount, thereby causing a shift in the time series sample path.

Usage

1
2
3
4
lag_t(x, ...)

## S3 method for class 'uts'
lag_t(x, lag_t, ...)

Arguments

x

a time series object.

...

further arguments passed to or from methods.

lag_t

a finite duration object, specifying how much to shift the observation times of x forward.

Methods (by class)

Note

For an evenly spaced time series (1) shifting observation times, and (2) shifting observation values essentinally gives the same result. For unevenly spaced time series, however, these two operations are quite different. The former affects only the observation times, while the latter affects only the observation values (apart from observations that are dropped).

See Also

lag.uts allows to shift observation values, as opposed to observation times.

Examples

1
2
lag_t(ex_uts(), ddays(3))
lag_t(ex_uts(), dhours(7.5))

andreas50/uts documentation built on April 8, 2021, 10:03 a.m.