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, ...)

Arguments

sensor

An AirSensor object.

...

Logical predicates defined in terms of the variables in sensor$meta.

Value

A subset of the incoming sensor.

Note

Filtering predicates are applied to the meta dataframe within the sensor object.

Examples

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] "SCAH"                   "SCAN"                   "SCUV"                  
#> [10] "San Jacinto"            "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"