maxLag: Give the maximal lag in an object

View source: R/lagged.R

maxLagR Documentation

Give the maximal lag in an object

Description

Give the maximal lag in an object, such as autocorrelations.

Usage

maxLag(object, ...)

Arguments

object

an object, for which the function makes sense.

...

not used?

Details

maxLag is a generic function to get the maximal lag for which information is available in lagged objects.

Value

a non-negative integer

Methods

signature(object = "Lagged")

This method applies to all classes inheriting from "Lagged".

signature(object = "array")
signature(object = "matrix")
signature(object = "vector")
signature(object = "ANY")
signature(object = "slMatrix")

Author(s)

Georgi N. Boshnakov

See Also

"maxLag<-"

Examples

## 1d
v <- Lagged(2^(0:6))
v
maxLag(v)
v[c(2,4,6)]
v[8] # NA
## reduce the number of lags in place
maxLag(v) <- 4
v
## extend the object (with NA's)
maxLag(v) <- 6
v
## extend using "["
v[5:8] <- 2^(5:8)
v

## 2d
m <- Lagged(matrix(1:12, nrow = 4))
m
maxLag(m)
maxLag(m) <- 1
m
## maxLag(m) <- 4 # extending this way doesn't work currently

lagged documentation built on Aug. 7, 2022, 5:19 p.m.