| lag_of | R Documentation |
Extract the k-th most recent value of a variable from sparse history as of (j, t).
lag_of(
name,
target,
k = 1,
lookback_t = NULL,
lookback_j = NULL,
include_current = FALSE,
force = FALSE,
na_value = NA,
clock = "time"
)
name |
Name of the derived feature. |
target |
A target created by declare_variable(). |
k |
Positive integer lag order (1 = most recent prior value by default). |
lookback_t |
Optional numeric lookback window on the time axis. Takes precedence over lookback_j. |
lookback_j |
Optional integer lookback window in event-index units. |
include_current |
Logical; include boundary event at t/j (default FALSE). |
force |
Logical; if TRUE return na_value when insufficient history exists (default FALSE). |
na_value |
Value to return when force=TRUE and insufficient history exists (default NA). |
clock |
Which column in entity$events defines the time axis for lookback_t (default "time"). |
A function (entity, j, t) -> scalar or NULL.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.