Skip to contents

Extract the subset of a "timeDate" object observed between two time stamps.

Usage

# S3 method for timeDate
window(x, start , end, ...)

# S3 method for timeDate
cut(x, from , to, ...)

Arguments

from, to

starting date, required, and end date, optional. If supplied to must be after from.

start, end

starting date, required, and end date, optional. If supplied to must be after from.

x

an object of class "timeDate".

...

arguments passed to other methods.

Value

an object of class "timeDate"

Note

The method for cut has been discouraged in the sources for a long time (with a recommendation to use window). It will be officially deprecated in the next release and later 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] [2023-01-01] [2023-02-01] [2023-03-01] [2023-04-01] [2023-05-01]
#>  [6] [2023-06-01] [2023-07-01] [2023-08-01] [2023-09-01] [2023-10-01]
#> [11] [2023-11-01] [2023-12-01]
   
## window -
   # 2nd Quarter Window:
   tS[4:6]
#> GMT
#> [1] [2023-04-01] [2023-05-01] [2023-06-01]
   window(tS, tS[4], tS[6])
#> GMT
#> [1] [2023-04-01] [2023-05-01] [2023-06-01]