Skip to contents

Methods for subsetting defined in package 'lagged'.

Methods

Subscripting "Lagged" objects always drops the Lagged-ness.

When i is missing, x[], returns the underlying data. This is equivalent to using x[0:maxLag(x)].

Subscripting (with one index) is defined naturally. It returns the suitably subscripted data slot (for "FlexibleLagged" it is the data slot of the data slot). For indices larger than the maximal lag the values are NA.

Currently negative indices work similarly to the standard R indexing in that negative indices are used to drop elements. However, for \(k>0\), using \(-k\) as an index drops the element for lag \(k-2\), not \(k\) (since the subsetting is done by something like x@data[i+1]). This is implementation detail, so it may be changed and should not be relied upon.

The following methods for "[" are currently defined in package "lagged":

signature(x = "FlexibleLagged", i = "missing", j = "ANY", drop = "ANY")

signature(x = "FlexibleLagged", i = "numeric", j = "missing", drop = "logical")

signature(x = "FlexibleLagged", i = "numeric", j = "missing", drop = "missing")

signature(x = "Lagged", i = "missing", j = "ANY", drop = "ANY")

signature(x = "Lagged1d", i = "numeric", j = "ANY", drop = "ANY")

signature(x = "Lagged2d", i = "numeric", j = "missing", drop = "logical")

signature(x = "Lagged2d", i = "numeric", j = "missing", drop = "missing")

signature(x = "Lagged3d", i = "numeric", j = "missing", drop = "logical")

signature(x = "Lagged3d", i = "numeric", j = "missing", drop = "missing")

signature(x = "slMatrix", i = "ANY", j = "ANY", drop = "ANY")

signature(x = "Lagged2d", i = "ANY", j = "ANY", drop = "character")

signature(x = "Lagged2d", i = "missing", j = "numeric", drop = "missing")

signature(x = "Lagged2d", i = "numeric", j = "numeric", drop = "missing")

signature(x = "FlexibleLagged", i = "missing", j = "missing", drop = "ANY")

signature(x = "ANY", i = "ANY", j = "ANY", drop = "ANY")

signature(x = "nonStructure", i = "ANY", j = "ANY", drop = "ANY")

signature(x = "Lagged2d", i = "character", j = "missing", drop = "logical")

signature(x = "Lagged2d", i = "character", j = "missing", drop = "missing")

signature(x = "Lagged2d", i = "character", j = "character", drop = "missing")

signature(x = "Lagged2d", i = "missing", j = "character", drop = "missing")

signature(x = "Lagged2d", i = "numeric", j = "character", drop = "missing")

signature(x = "Lagged2d", i = "character", j = "numeric", drop = "missing")