View source: R/mts_filterData.R
mts_filterData | R Documentation |
A generalized data filter for mts objects to
choose rows/cases where conditions are true. Multiple conditions may be
combined with &
or separated by a comma. Only rows where the condition
evaluates to TRUE are kept. Rows where the condition evaluates to NA
are dropped.
mts_filterData(mts, ...)
mts |
mts object. |
... |
Logical predicates defined in terms of the variables in
|
A subset of the incoming mts time series object.
(A list with meta
and data
dataframes.)
Filtering is done on variables in mts$data
and results in an
incomplete and irregular time axis.
mts_filterMeta
library(MazamaTimeSeries)
# Are there any times when data exceeded 150?
sapply(example_mts$data, function(x) { any(x > 150, na.rm = TRUE) })
# Show all times where da4cadd2d6ea5302_4686 > 150
example_mts %>%
mts_filterData(da4cadd2d6ea5302_4686 > 150) %>%
mts_extractData() %>%
dplyr::pull(datetime)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.