Pure Time Series Filtering Flexibilty
The .start_date
and .end_date
parameters are designed with flexibility in mind.
Each side of the time_formula
is specified as the character
'YYYY-MM-DD HH:MM:SS'
, but powerful shorthand is available.
Some examples are:
Year: .start_date = '2013', .end_date = '2015'
Month: .start_date = '2013-01', .end_date = '2016-06'
Day: .start_date = '2013-01-05', .end_date = '2016-06-04'
Second: .start_date = '2013-01-05 10:22:15', .end_date = '2018-06-03 12:14:22'
Variations: .start_date = '2013', .end_date = '2016-06'
Key Words: "start" and "end"
Use the keywords "start" and "end" as shorthand, instead of specifying the
actual start and end values. Here are some examples:
Start of the series to end of 2015: .start_date = 'start', .end_date = '2015'
Start of 2014 to end of series: .start_date = '2014', .end_date = 'end'
Internal Calculations
All shorthand dates are expanded:
This means that the following examples are equivalent (assuming your
index is a POSIXct):