.reformat_k {runner} | R Documentation |
Formats time-unit-interval to valid for runner
Description
Formats time-unit-interval to valid for runner. User specifies k
as
positive number but this means that this interval needs to be substracted
from idx
- because windows length extends window backwards in time.
The same situation for lag.
Usage
.reformat_k(k, only_positive = TRUE)
Arguments
k |
(k or lag) object from runner to be formatted |
only_positive |
for |
Examples
runner:::.reformat_k("1 days")
runner:::.reformat_k("day")
runner:::.reformat_k("10 days")
runner:::.reformat_k("-10 days", only_positive = FALSE)
runner:::.reformat_k(c("-10 days", "2 months"), only_positive = FALSE)
[Package runner version 0.4.4 Index]