View source: R/pas_filterNearMonitor.R
pas_filterNearMonitor | R Documentation |
Filter for PurpleAir sensors within a specified distance from a monitoring site.
pas_filterNearMonitor(pas = NULL, monitor = NULL, radius = "1 km")
pas |
PurpleAir pas object. |
monitor |
mts_monitor object from the AirMonitor package. |
radius |
Distance from target with unit (i.e "1000 m"). |
The radius
parameter should be a numeric string with a metric
unit separated by a space, such as "250 m"
or "10 km"
. The
resulting pas will be contain only those sensors that are within
'radius' of one of the device-deployments in monitor
.
Three additional columns of metadata will be added to the returned pas object:
monitor_DDID
– nearest monitor deviceDeploymentID
monitor_AQSID
– nearest monitor AQSID (if any)
monitor_distance
– distance in meters to the nearest monitor
A subset of the incoming pas object with additional fields.
pas_filter
pas_filterArea
pas_filterNear
library(AirSensor2)
monitor <-
AirMonitor::NW_Megafires %>%
AirMonitor::monitor_filter(countyName == "Okanogan")
pas <-
example_pas_pm25 %>%
pas_filter(countyName == "Okanogan")
# Near Omak, WA
pas_near_monitors <-
pas %>%
pas_filterNearMonitor(
monitor,
radius = "1000 m"
)
pas_near_monitors %>%
dplyr::select(sensor_index, locationName, monitor_AQSID, monitor_distance)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.