rolling_time_window: Rolling Time Window

Description Usage Arguments Value Examples

View source: R/rolling_apply.R

Description

Generate a sequence of start times and end times for a rolling time window of specified width.

Usage

1

Arguments

start

a POSIXct object or coercible using as.POSIXct. The start time of the first time window.

end

a POSIXct object or coercible using as.POSIXct. The maximum end time of the last time window.

width

a non-negative duration object, specifying the temporal width of the rolling time window.

by

a positive duration object. The temporal spacing between start times (and therefore also end times) of adjacent time windows.

interior

logical. If TRUE, only include time windows [start_times[i], end_times[i]] in the output that are in the interior of the temporal support of x, i.e. in the interior of the time interval [start(x), end(x)].

Value

A list with two POSIXct objects of equal length, specifying the start and end times of the rolling time window.

Examples

1
2
3
rolling_time_window(start="2015-01-01", end="2015-06-30", width=ddays(90), by=ddays(30))
rolling_time_window(start="2015-01-01", end="2015-06-30", width=ddays(90), by=ddays(30),
  interior=TRUE)

andreas50/utsOperators documentation built on May 25, 2019, 7:16 a.m.