Collapses data from all time series in
mts into a
single-time series mts object using the function provided in the
FUN argument. The single-time series result will be located at the mean
longitude and latitude unless
Any columns of
mts$meta that are constant across all records will be
retained in the returned
The core metadata associated with this location (e.g.
countryCode, stateCode, timezone, ...) will be determined from
the most common (or average) value found in
mts$meta. This will be
a reasonable assumption for the vast majority of intended use cases where
data from multiple devices in close proximity are averaged together.
mts_collapse( mts, longitude = NULL, latitude = NULL, deviceID = "generatedID", FUN = mean, na.rm = TRUE, ... )
Longitude of the collapsed time series.
Latitude of the collapsed time series.
Device identifier for the collapsed time series.
Function used to collapse multiple time series.
Logical specifying whether NA values should be ignored when FUN is applied.
additional arguments to be passed on to the
An mts time series object representing a single time series.
(A list with
FUN is applied, values of
NA. This is a convenience for the common case where
FUN = min/max or
FUN = mean and some of the time steps have all
missing values. See the R documentation for
min for an explanation.