consec_idx | R Documentation |
This function iterates through values using a sliding window, applying a condition and evaluate it to each sub-window then return the first or last index of the windows that match condition
consec_idx(index, value, expr, .after = 7, .f = "min", .messages = F)
index |
date. i-ndex date. |
value |
numeric. Count values. |
expr |
expression. type of .x > 2. |
.after |
The number of values after the current element of .i to include in the sliding window. Set to Inf to select all elements after the current element. Negative values are allowed, which allows you to "look backwards". |
.f |
function to apply to find min o max of all windows. |
messages |
show messages for more information about the windows. |
window's vector.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.