Learn R Programming

fts (version 0.7.5)

lead.lag: Shift an Fts ojbect in time

Description

Shift an Fts ojbect forward or backwards in time be the supplied number of periods

Usage

## S3 method for class 'fts':
lead(x, k, \dots)
## S3 method for class 'fts':
lag(x, k, \dots)

Arguments

x
An Fts object
k
number of periods to shift
...
further arguments to function

Value

  • an Fts object

Details

removed elements are replaced with NA

Examples

Run this code
x <- fts(rnorm(5))
print(x)
lag(x,1)
lead(x,1)

Run the code above in your browser using DataLab