View source: R/monitor_filterMeta.R
monitor_filterMeta | R Documentation |
A generalized metadata filter for mts_monitor objects to
choose cases where conditions are true. Multiple conditions are
combined with &
or separated by a comma. Only rows where the condition
evaluates to TRUE are kept. Rows of monitor$meta
where the condition
evaluates to NA
are dropped. Associated olumns of monitor$data
are also dropped for internal consistency in the returned mts_monitor
object.
monitor_filter()
is an alias for monitor_filterMeta()
.
monitor_filterMeta(monitor, ...)
monitor_filter(monitor, ...)
monitor |
mts_monitor object. |
... |
Logical predicates defined in terms of the variables in
|
A subset of the incoming mts_monitor
. (A list with
meta
and data
dataframes.)
Filtering is done on variables in monitor$meta
.
monitor_filterDate
monitor_filterDatetime
library(AirMonitor)
# Filter based on countyName field
Camp_Fire %>%
monitor_filter(countyName == "Alameda") %>%
monitor_timeseriesPlot(main = "All Alameda County Monitors")
# Filter combining two fields
Camp_Fire %>%
monitor_filter(latitude > 39.5, longitude > -121.5) %>%
monitor_pull("locationName")
# Filter using string matching
Camp_Fire %>%
monitor_filter(stringr::str_detect(locationName, "^San")) %>%
monitor_pull("locationName")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.