Columns of numeric data in sts$data
are grouped by unit
and then
summarized using FUN
.
Columns with non-numeric data are summarized by just picking the first
occurrence in each unit
. This preserves the utility of columns
containing repeated metadata.
The most typical use case is creating daily averages where each day begins at
midnight. Day boundaries are calculated using the specified timezone
or, if NULL
, the time zone found in sts$meta$timezone[1]
.
Leaving timezone = NULL
, the default, results in "local time" date
filtering which is the most common use case.
sts_summarize(
sts,
timezone = NULL,
unit = c("day", "week", "month", "year"),
FUN = NULL,
...,
minCount = NULL
)
sts object.
Olson timezone used to interpret dates.
Unit used to summarize by (e.g. "day").
Function used to summarize time series.
Additional arguments to be passed to FUN
(_e.g._ na.rm = TRUE
).
Minimum number of valid data records required to calculate
summaries. Time periods with fewer valid records will be assigned NA
.
An sts time series object containing daily (or other)
statistical summaries.
(A list with meta
and data
dataframes.)