pas_filterNear: Find PurpleAir sensors within radial distance

Description Usage Arguments Details Value See Also Examples

View source: R/pas_filterNear.R

Description

Filter for PurpleAir sensors within a specified distance from specified target coordinates.

Usage

1
pas_filterNear(pas = NULL, longitude = NULL, latitude = NULL, radius = "1 km")

Arguments

pas

PurpleAir pas object.

longitude

a Target longitude.

latitude

a Target latitude.

radius

Distance from target with unit (i.e "15 km").

Details

radius Should be a numeric string with a metric unit separated by a space, such as "250 m".

Value

A subset of the given pas object.

See Also

pas_filter

pas_filterArea

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(AirSensor)

# Near Diamond Bar, CA
pas <- example_pas
diamond_bar <-
  pas %>%
  pas_filterNear(
    longitude = -117.820833,
    latitude = 34.001667, 
    radius = "20 km"
  )
                 
if ( interactive() ) {
  pas_leaflet(diamond_bar)
}

AirSensor documentation built on March 13, 2021, 1:07 a.m.