.k_by: Converts k and lag from time-unit-interval to int
Description
Converts k and lag from time-unit-interval to int
Usage
.k_by(k, idx, param)
Arguments
k
(integer vector or single value)
Denoting size of the running window. If k is a single value then window
size is constant for all elements, otherwise if length(k) == length(x)
different window size for each element. One can also specify k in the same
way as by argument in base::seq.POSIXt().
See 'Specifying time-intervals' in details section.
idx
(integer, Date, POSIXt)
Optional integer vector containing sorted (ascending) index of observation.
By default idx is index incremented by one. User can provide index with
varying increment and with duplicated values. If specified then k and
lag are depending on idx. Length of idx have to be equal of length
x.
param
name of the parameter to be printed in error message