Learn R Programming

AirMonitor (version 0.4.2)

monitor_combine: 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")
)

Value

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

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.

Examples

Run this code
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()

Run the code above in your browser using DataLab