monitor_slice_head | R Documentation |
An mts_monitor object is reduced so as to contain only
the first or last n
timeseries. These functions work similarly to
dplyr::slice_head
and
dplyr::slice_tail
but apply to both dataframes in the mts_monitor object.
This is primarily useful when the mts_monitor object has been ordered
by a previous call to monitor_arrange
or by some other means.
monitor_slice_head()
selects the first and monitor_slice_tail()
the last timeseries in the object.
monitor_slice_head(monitor, n = 5)
monitor_slice_tail(monitor, n = 5)
monitor |
mts_monitor object. |
n |
Number of rows of |
A subset of the incoming mts_monitor time series object.
(A list with meta
and data
dataframes.)
library(AirMonitor)
# Find lowest elevation sites
Camp_Fire %>%
monitor_filter(!is.na(elevation)) %>%
monitor_arrange(elevation) %>%
monitor_slice_head(n = 5) %>%
monitor_getMeta() %>%
dplyr::select(elevation, locationName)
# Find highest elevation sites
Camp_Fire %>%
monitor_filterMeta(!is.na(elevation)) %>%
monitor_arrange(elevation) %>%
monitor_slice_tail(n = 5) %>%
monitor_getMeta() %>%
dplyr::select(elevation, locationName)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.