A generalized data filter for *pas* objects to choose rows/cases where conditions are true. Rows where the condition evaluates to NA are dropped.
This function is essentially [dplyr::filter()] with an extra check on the validity of the *pas* object.
pas_filter(pas, ...)A subset of the incoming *pas* object.
[pas_filterArea()]
[pas_filterNear()]
[pas_filterNearMonitor()]
library(AirSensor2)
nrow(example_pas_pm25)
#> [1] 2287
# Washington
WA_pas <-
example_pas_pm25 %>%
pas_filter(stateCode == "WA")
nrow(WA_pas)
#> [1] 1373
# Okanogan and Ferry Counties
Colville_Tribes_pas <-
example_pas_pm25 %>%
pas_filter(stateCode == "WA") %>%
pas_filter(countyName %in% c("Okanogan", "Ferry"))
nrow(Colville_Tribes_pas)
#> [1] 80