pas_filterNearMonitor: Find PurpleAir sensors near a monitor

View source: R/pas_filterNearMonitor.R

pas_filterNearMonitorR Documentation

Find PurpleAir sensors near a monitor

Description

Filter for PurpleAir sensors within a specified distance from a monitoring site.

Usage

pas_filterNearMonitor(pas = NULL, monitor = NULL, radius = "1 km")

Arguments

pas

PurpleAir pas object.

monitor

mts_monitor object from the AirMonitor package.

radius

Distance from target with unit (i.e "1000 m").

Details

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:

  1. monitor_DDID – nearest monitor deviceDeploymentID

  2. monitor_AQSID – nearest monitor AQSID (if any)

  3. monitor_distance – distance in meters to the nearest monitor

Value

A subset of the incoming pas object with additional fields.

See Also

pas_filter

pas_filterArea

pas_filterNear

Examples

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)


MazamaScience/AirSensor2 documentation built on Oct. 31, 2024, 1:39 a.m.