pas_filter: General purpose filtering for PurpleAir Synoptic objects

Description Usage Arguments Value See Also Examples

View source: R/pas_filter.R

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

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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")
}

AirSensor documentation built on March 13, 2021, 1:07 a.m.