dot-reformat_k: Formats time-unit-interval to valid for runner

.reformat_kR 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 k is TRUE, for lag is FALSE

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)

runner documentation built on May 29, 2024, 10:22 a.m.