inclusive_window_gen: Create a sliding window iterator generator

Description Usage Arguments Value

View source: R/windows.r

Description

Create a sliding window iterator generator

Usage

1
inclusive_window_gen(sorted_times, interval = minutes(5), skip = 1)

Arguments

sorted_times

a vector of date-times in ascending order.

interval

a time interval. The default is minutes(5).

skip

elements on the interval.

Value

an iterator that, when called with nextElem returns the indices in the next window. data(aapl_fix) aapl_fix$dt_string = paste(aapl_fix$sys_date, aapl_fix$sys_time) aapl_fix$dt = strptime(aapl_fix$dt_string, " it = inclusive_window_gen(aapl_fix$dt) window1 = nextElem(it) aapl_fix$dt[c(window1[1], tail(window1, 1)] window2 = nextElem(it) aapl_fix$dt[c(window2[1], tail(window2, 1)]


hafen/nxcore documentation built on May 17, 2019, 2:03 p.m.