View source: R/monitor_filterByDistance.R
monitor_filterByDistance | R Documentation |
Filters the monitor
argument to include only those time series
located within a certain radius of a target location. If no time series fall
within the specified radius
, an empty mts_monitor object will
be returned.
When count
is used, a mts_monitor object is
created containing up to count
time series, ordered by
increasing distance from the target location. Note that the number
of monitors returned may be less than the specified count
value if
fewer than count
time series are found within the target area.
monitor_filterByDistance(
monitor,
longitude = NULL,
latitude = NULL,
radius = 50,
count = NULL,
addToMeta = FALSE
)
monitor |
mts_monitor object. |
longitude |
Target longitude. |
latitude |
Target. |
radius |
Distance (m) of radius defining a target area. |
count |
Number of time series to return. |
addToMeta |
Logical specifying whether to add |
A mts_monitor object with monitors near a location.
The returned mts_monitor will have an extra distance
. (A list with
meta
and data
dataframes.)
library(AirMonitor)
# Walla Walla
longitude <- -118.330278
latitude <- 46.065
Walla_Walla_monitors <-
NW_Megafires %>%
monitor_filterByDistance(
longitude = -118.330,
latitude = 46.065,
radius = 50000, # 50 km
addToMeta = TRUE
)
Walla_Walla_monitors %>%
monitor_getMeta() %>%
dplyr::select(c("locationName", "distanceFromTarget"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.