monitor_combine {AirMonitor}R Documentation

Combine multiple mts_monitor objects

Description

Create a combined mts_monitor from any number of mts_monitor objects or from a list of mts_monitor objects. The resulting mts_monitor object with contain all deviceDeploymentIDs found in any incoming mts_monitor and will have a regular time axis covering the the entire range of incoming data.

If incoming time ranges are tempporally non-contiguous, the resulting mts_monitor will have gaps filled with NA values.

An error is generated if the incoming mts_monitor objects have non-identical metadata for the same deviceDeploymentID unless replaceMeta = TRUE.

Usage

monitor_combine(
  ...,
  replaceMeta = FALSE,
  overlapStrategy = c("replace all", "replace na")
)

Arguments

...

Any number of valid mts_monitor objects or a list of objects.

replaceMeta

Logical specifying whether to allow replacement of metadata associated when duplicate deviceDeploymentIDs are encountered.

overlapStrategy

Strategy to use when data found in time series overlaps.

Value

A combined mts_monitor object. (A list with meta and data dataframes.)

Note

Data are combined with a "later is better" sensibility where any data overlaps exist. Incoming mts_monitor objects are ordered based on the time stamp of their last record. Any data records found in a "later" mts_monitor will overwrite data associated with an "earlier" mts_monitor.

With overlapStrategy = "replace all", any data records found in "later" mts_monitor objects are preferentially retained before the "shared" data are finally reordered by ascending datetime.

With overlapStrategy = "replace missing", only missing values in "earlier" mts_monitor objects are replaced with data records from "later" time series.

Examples

library(AirMonitor)

# Two monitors near Pendelton, Oregon
#
# Use the interactive map to get the deviceDeploymentIDs
#   NW_Megafires %>% monitor_leaflet()

Pendleton_West <-
  NW_Megafires %>%
  monitor_select("f187226671d1109a_410590121_03") %>%
  monitor_filterDatetime(2015082300, 2015082305)

Pendleton_East <-
  NW_Megafires %>%
  monitor_select("6c906c6d1cf46b53_410597002_02") %>%
  monitor_filterDatetime(2015082300, 2015082305)

monitor_combine(Pendleton_West, Pendleton_East) %>%
  monitor_getData()


[Package AirMonitor version 0.4.0 Index]