R/pas_filterArea.R
pas_filterArea.Rd
Filters pas object sensors based on a bounding box.
pas_filterArea(pas = NULL, w = NULL, e = NULL, s = NULL, n = NULL)
PurpleAir Synoptic pas object.
West edge of area bounding box (deg E).
East edge of area bounding box (deg E).
South edge of area bounding box (deg N).
North edge of area bounding box (deg N).
A subset of the given pas object.
library(AirSensor)
pas <- example_pas
range(pas$longitude)
#> [1] -121.9464 -116.7077
range(pas$latitude)
#> [1] 33.45717 37.10762
scsb <-
pas %>%
pas_filterArea(
w = -118.10,
e = -118.07,
s = 33.75,
n = 33.78
)
range(scsb$longitude)
#> [1] -118.0945 -118.0782
range(scsb$latitude)
#> [1] 33.75989 33.77767
if ( interactive() ) {
pas_leaflet(scsb)
}