pas_filter {AirSensor}R Documentation

General purpose filtering for PurpleAir Synoptic objects

Description

A generalized data filter for pas objects to choose rows/cases where conditions are true. Rows where the condition evaluates to NA are dropped.

Usage

pas_filter(pas, ...)

Arguments

pas

PurpleAir Synoptic pas object.

...

Logical predicates defined in terms of the variables in the pas. Multiple conditions are combined with & or seperated by a comma. Only rows where the condition evaluates to TRUE are kept.

Value

A subset of the given pas object.

See Also

pas_filterArea, pas_filterNear

Examples

library(AirSensor)

nrow(example_pas)

# California
ca <- pas_filter(example_pas, stateCode == "CA")
nrow(ca)

# Seal Beach
scsb <- 
  ca %>%
  pas_filter(stringr::str_detect(label, "^SCSB_"))
nrow(scsb)

if ( interactive() ) {
  pas_leaflet(ca)

  pas_leaflet(scsb, maptype = "satellite")
}


[Package AirSensor version 1.0.8 Index]