Subsets a pat object by date. This function
always filters to day-boundaries. For sub-day filtering, use
pat_filterDatetime()
.
Dates can be anything that is understood by MazamaCoreUtils::parseDatetime()
including either of the following recommended formats:
"YYYYmmdd"
"YYYY-mm-dd"
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
pat_filterDate(
pat = NULL,
startdate = NULL,
enddate = NULL,
timezone = NULL,
unit = "sec",
ceilingStart = FALSE,
ceilingEnd = FALSE
)
pat object.
Desired start datetime (ISO 8601).
Desired end datetime (ISO 8601).
Olson timezone used to interpret dates.
Units used to determine time at end-of-day.
Logical instruction to apply
ceiling_date
to the startdate
rather than
floor_date
Logical instruction to apply
ceiling_date
to the enddate
rather than
floor_date
A subset of the incoming pat time series object.
(A list with meta
and data
dataframes.)
The returned data will run from the beginning of startdate
until
the beginning of enddate
-- i.e. no values associated
with enddate
will be returned. The exception being when
enddate
is less than 24 hours after startdate
. In that case, a
single day is returned.