A generalized data filter for sensor objects to
choose rows/cases where conditions are true. Multiple conditions are
combined with &
or seperated by a comma. Only rows where the condition
evaluates to TRUE are kept.Rows where the condition evaluates to NA
are dropped.
sensor_filterMeta(sensor = NULL, ...)
sensor | An AirSensor object. |
---|---|
... | Logical predicates defined in terms of the variables in
|
A subset of the incoming sensor.
Filtering predicates are applied to the meta
dataframe within
the sensor object.
library(AirSensor) example_sensor_scaqmd %>% sensor_extractMeta() %>% dplyr::pull("communityRegion") %>% sort () %>% unique()#> [1] "Alhambra/Monterey Park" "Big Bear Lake" "El Monte" #> [4] "Imperial Valley" "Nipomo" "Paso Robles" #> [7] "San Jacinto" "SCAH" "SCAN" #> [10] "SCUV" "Seal Beach" "South Gate" #> [13] "Sycamore Canyon" "Temescal Valley"example_sensor_scaqmd %>% sensor_filterMeta(communityRegion == "Imperial Valley") %>% sensor_extractMeta() %>% dplyr::pull("communityRegion") %>% sort () %>% unique()#> [1] "Imperial Valley"