Datetime filtering for *pat* time series objects
Source:R/pat_filterDatetime.R
pat_filterDatetime.RdSubsets a *pat* object by datetime. This function allows for sub-day filtering as opposed to `pat_filterDate()` which always filters to day-boundaries.
Datetimes can be anything that is understood by `MazamaCoreUtils::parseDatetime()`. For non-`POSIXct` values, the recommended format is `"YYYY-mm-dd HH:MM:SS"`.
Timezone determination precedence assumes that if you are passing in `POSIXct` values then you know what you are doing.
get timezone from `startdate` if it is `POSIXct`
use passed in `timezone`
get timezone from `pat`
Usage
pat_filterDatetime(
pat = NULL,
startdate = NULL,
enddate = NULL,
timezone = NULL,
unit = "sec",
ceilingStart = FALSE,
ceilingEnd = FALSE
)Arguments
- pat
*pat* object.
- startdate
Desired start datetime (ISO 8601).
- enddate
Desired end datetime (ISO 8601).
- timezone
Olson timezone used to interpret dates.
- unit
Units used to determine time at end-of-day.
- ceilingStart
Logical instruction to apply [lubridate::ceiling_date()] to the `startdate` rather than [lubridate::floor_date()]
- ceilingEnd
Logical instruction to apply [lubridate::ceiling_date()] to the `enddate` rather than [lubridate::floor_date()]