Class Lagged1d
Lagged1d-class.RdClass Lagged1d.
Objects from the Class
Objects can be created by calls of the form Lagged(v) or
new("Lagged1d", data = v), where v is a vector.
new("Lagged1d", ...) also works.
Extends
Class "Lagged", directly.
Methods
- [<-
signature(x = "Lagged1d", i = "numeric"): ...- [
signature(x = "Lagged1d", i = "numeric", j = "ANY", drop = "ANY"): ...- show
signature(object = "Lagged1d"): ...- whichLagged
signature(x = "Lagged1d", y = "missing"): ...
Examples
v <- cos(2*pi*(0:10)/10)
new("Lagged1d", data = v) ## ok, but Lagged() is more convenient
#> An object of class "Lagged1d"
#> Slot *data*:
#> Lag_0 Lag_1 Lag_2 Lag_3 Lag_4 Lag_5 Lag_6 Lag_7
#> 1.000000 0.809017 0.309017 -0.309017 -0.809017 -1.000000 -0.809017 -0.309017
#> Lag_8 Lag_9 Lag_10
#> 0.309017 0.809017 1.000000
x <- Lagged(v)
class(x) # Lagged1d
#> [1] "Lagged1d"
#> attr(,"package")
#> [1] "lagged"
x
#> An object of class "Lagged1d"
#> Slot *data*:
#> Lag_0 Lag_1 Lag_2 Lag_3 Lag_4 Lag_5 Lag_6 Lag_7
#> 1.000000 0.809017 0.309017 -0.309017 -0.809017 -1.000000 -0.809017 -0.309017
#> Lag_8 Lag_9 Lag_10
#> 0.309017 0.809017 1.000000
x[0]
#> [1] 1
x[0:3]
#> [1] 1.000000 0.809017 0.309017 -0.309017