
Last chance! 50% off unlimited learning
Sale ends in
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.
reformat_k(k, only_positive = TRUE)
(k or lag) object from runner to be formatted
for k
is TRUE
,
for lag
is FALSE
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)
Run the code above in your browser using DataLab