Description Usage Arguments Value Examples
1 2 3 |
1 |
x |
xts object |
k |
choose -1 to look into the future |
na.pad |
as lag.xts |
... |
dots passed to lag.xts |
xts object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ## Not run:
xts(1:4, zoo::as.Date(0:3))
[,1]
1970-01-01 1
1970-01-02 2
1970-01-03 3
1970-01-04 4
lagXts(xts(1:4, zoo::as.Date(0:3)), k = c(-5:-3,0:1,3:5))
V1lead.4 V1lead.3 V1lag.0 V1lag.1 V1lag.3 V1lag.4
1970-01-01 NA 4 1 NA NA NA
1970-01-02 NA NA 2 1 NA NA
1970-01-03 NA NA 3 2 NA NA
1970-01-04 NA NA 4 3 1 NA
xts(matrix(1:4,ncol =2), zoo::as.Date(0:1))
[,1] [,2]
1970-01-01 1 3
1970-01-02 2 4
lagXts(xts(matrix(1:4,ncol =2), zoo::as.Date(0:1)), k = c(-5:-3,0:1,3:5))
V1lag.0 V2lag.0 V1lag.1 V2lag.1
1970-01-01 1 3 NA NA
1970-01-02 2 4 1 3
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.