Time windows
stats-window.RdExtract the subset of a "timeDate" object observed between two
time stamps.
Usage
# S3 method for class 'timeDate'
window(x, start , end, ...)
# S3 method for class 'timeDate'
cut(x, from , to, ...)Note
The method for cut has been discouraged in the sources for a
long time (with a recommendation to use window). It was
officially deprecated in v4032.109 and will be removed or replaced by
a method that is consistent with the methods for cut in base R,
Examples
## timeCalendar
# monthly dates in current year
tS = timeCalendar()
tS
#> GMT
#> [1] [2025-01-01] [2025-02-01] [2025-03-01] [2025-04-01] [2025-05-01]
#> [6] [2025-06-01] [2025-07-01] [2025-08-01] [2025-09-01] [2025-10-01]
#> [11] [2025-11-01] [2025-12-01]
## window
# 2nd quarter window:
tS[4:6]
#> GMT
#> [1] [2025-04-01] [2025-05-01] [2025-06-01]
window(tS, tS[4], tS[6])
#> GMT
#> [1] [2025-04-01] [2025-05-01] [2025-06-01]