Learn R Programming

dse (version 2006.10-1)

tfdiff: Time Series Differencing

Description

Difference a tframed object.

Usage

tfdiff(x, lag=1, differences=1)
    ## S3 method for class 'default':
tfdiff(x,lag=1, differences=1)
    ## S3 method for class 'tframe':
tfdiff(x,lag=1, differences=1)
    ## S3 method for class 'tframed':
diff(x,lag=1, differences=1, ...)

Arguments

x
a tframed object.
lag
difference calculated relative to lag periods previous.
differences
order of differencing.
...
arguments to be passed to other methods.

Details

A time framed object is created by differencing the number of times indicated by differences at a lagged number of periods indicated by lag. The default is take the difference from data one period previous.

See Also

diff, lag

Examples

Run this code
z <- ts(rnorm(100), start=c(1982,1), frequency=12)
    tfstart(z)
    tfperiods(z)
    z <- tfdiff(z)
    tfstart(z)
    tfperiods(z)

Run the code above in your browser using DataLab