Description Usage Arguments Value Examples
View source: R/rolling_apply.R
For a sorted sequence of time points, determine the start and end indices inside a half-open (open on the left, closed on the right) rolling time window.
1 | rolling_time_window_indices(times, start_times, end_times)
|
times |
a |
start_times |
a strictly increasing |
end_times |
a strictly increasing |
A list with two integer vectors of equal length, specifying the start and end index in times
of each rolling time window. If the start index is larger than the end index, that means that no observation lies in the corresponding time window.
1 2 3 | tmp <- rolling_time_window(start="2015-01-01", end="2015-06-30", width=ddays(90), by=ddays(30))
times <- seq(as.POSIXct("2014-12-01"), as.POSIXct("2015-12-30"), by="week")
rolling_time_window_indices(times, tmp$start_times, tmp$end_times)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.