Description Usage Arguments Value Examples
View source: R/IRmapping_functions.R
Finds the index, for each row, of the previous row with a non-zero value
1 |
x |
Numeric vector. |
first |
(logical) Whether to consider first value as a non-zero value whose index is moved forward even if it is zero. This prevents having NAs in the results and somewhat assumes that, for a time series, the day prior to the first value is non-zero. |
Numeric vector of the indices of the previous non-zero for each element of the input vector.
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.