Filter for PurpleAir sensors within a specified distance from a target location.
pas_filterNear(pas = NULL, longitude = NULL, latitude = NULL, radius = "1 km")
PurpleAir pas object.
a Target longitude.
a Target latitude.
Distance from target with unit (i.e "15 km").
A subset of the incoming pas object.
The radius
parameter should be a numeric string with a metric unit
separated by a space, such as "250 m"
or "10 km"
.
library(AirSensor2)
# Near Omak, WA
Omak_pas <-
example_pas_pm25 %>%
pas_filterNear(
longitude = -119.5375,
latitude = 48.4125,
radius = "20 km"
)
if ( interactive() ) {
pas_leaflet(Omak_pas)
}