This function acts similarly to pull working on monitor$meta or monitor$data. Data are returned as a simple array. Data are pulled from whichever dataframe contains var.

monitor_pull(monitor = NULL, var = NULL)

Arguments

monitor

mts_monitor object.

var

A variable name found in the meta or data dataframe of the incoming mts_monitor time series object.

Value

An array of values.

Examples

library(AirMonitor)

# Metadata
Camp_Fire %>%
  monitor_pull("deploymentType") %>%
  table()
#> .
#> Permanent Temporary 
#>       101        33 

# Data for a specific ID
Camp_Fire %>%
  monitor_dailyStatistic(mean) %>%
  monitor_pull("6bbab08e3786ef66_840060450006") %>%
  round(0)
#>  [1]  28 261 198 106  50  71  49  41  54  65  68  60  48  11   7

# Associated dates
Camp_Fire %>%
  monitor_dailyStatistic(mean) %>%
  monitor_pull("datetime")
#>  [1] "2018-11-08 PST" "2018-11-09 PST" "2018-11-10 PST" "2018-11-11 PST"
#>  [5] "2018-11-12 PST" "2018-11-13 PST" "2018-11-14 PST" "2018-11-15 PST"
#>  [9] "2018-11-16 PST" "2018-11-17 PST" "2018-11-18 PST" "2018-11-19 PST"
#> [13] "2018-11-20 PST" "2018-11-21 PST" "2018-11-22 PST"