Description Usage Arguments Value Examples
1 2 3 |
1 |
x |
xts object |
k |
choose 0 or 1 or greater to peer into the current and the past |
... |
dots passed |
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 | ## Not run:
# LG(lag 1) example
xts(matrix(c(1,-2,-4,8,16,32), ncol = 2), zoo::as.Date(0:2))
[,1] [,2]
1970-01-01 1 8
1970-01-02 -2 16
1970-01-03 -4 32
LG(xts(matrix(c(1,-2,-4,8,16,32), ncol = 2), zoo::as.Date(0:2)))
V1lg.1 V2lg.1
1970-01-01 NA NA
1970-01-02 1 8
1970-01-03 -2 16
# LG(lag 1 and 2 example)
LG(xts(matrix(c(1,-2,-4), ncol = 1), zoo::as.Date(0:2)), k = 1:2)
V1lg.1 V2lg.2
1970-01-01 NA NA
1970-01-02 1 NA
1970-01-03 -2 1
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.