Rectangle area filtering for PurpleAir Synoptic objects
Source:R/pas_filterArea.R
pas_filterArea.RdFilters *pas* object sensors based on a bounding box.
Value
A subset of the given *pas* object containing only records within the bounding box. This includes sensors located precisely on a boundary.
Examples
library(AirSensor2)
pas <- example_pas_pm25
range(pas$longitude)
#> [1] -124.6264 -116.9615
range(pas$latitude)
#> [1] 42.01015 48.99036
Lane_County_pas <-
pas %>%
pas_filterArea(
w = -124.16,
e = -121.76,
s = 43.43,
n = 44.30
)
range(Lane_County_pas$longitude)
#> [1] -124.1012 -121.9334
range(Lane_County_pas$latitude)
#> [1] 43.51040 44.28334
if ( interactive() ) {
pas_leaflet(Lane_County_pas)
}