View source: R/monitor_selectWhere.R
monitor_selectWhere | R Documentation |
Subsetting of monitor
acts similarly to tidyselect::where()
working on
monitor$data
. The returned mts_monitor object will contain only
those time series where FUN
applied to the time series data returns TRUE
.
monitor_selectWhere(monitor, FUN)
monitor |
mts_monitor object. |
FUN |
A function applied to time series data that returns TRUE or FALSE. |
A subset of the incoming mts_monitor object. (A list with
meta
and data
dataframes.)
monitor_select
library(AirMonitor)
# Show all Camp_Fire locations
Camp_Fire$meta$locationName
# Use package US_AQI data for HAZARDOUS
name <- US_AQI$names_eng[6]
threshold <- US_AQI$breaks_PM2.5[6]
# Find HAZARDOUS locations
worst_sites <-
Camp_Fire %>%
monitor_selectWhere(
function(x) { any(x >= threshold, na.rm = TRUE) }
)
# Show the worst locations
worst_sites$meta$locationName
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.