Description Usage Arguments Details Value Author(s) Examples
computeLag shifts the dataset forward or backward by a given number of observations.
1 | computeLag(x, move = 0, value = NA)
|
x |
a (non-empty) data.frame, data.table object or input data of class "xpssFrame". |
move |
atomic integer, either positive or negative that defines the cases to move. The algebraic sign indicates the direction. |
value |
atomic numeric or atomic character value that replaces the skipped cases. |
Creates shifted data dependent upon the direction in which the data got moved.
A positive indicator refers a shift to the right side, a negative indicator refers a shift of the data to the left side. Empty cases get filled with NA.
Output is the shifted, respectively "lagged" input vector.
Length of the new lagged vector is identical with the length of the input vector.
Andreas Wygrabek
1 2 | data(fromXPSS)
computeLag(x=fromXPSS$V6, move = 2, value = NA)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.