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