View source: R/mts_filterMeta.R
mts_filterMeta | R Documentation |
A generalized metadata filter for mts objects to
choose rows/cases where conditions are true. Multiple conditions are
combined with &
or separated by a comma. Only rows where the condition
evaluates to TRUE are kept. Rows where the condition evaluates to FALSE or
NA
are dropped.
If an empty mts object is passed in, it is immediately returned, allowing for multiple filtering steps to be piped together and only checking for an empty mts object at the end of the pipeline.
mts_filterMeta(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$meta
.
mts_filterData
library(MazamaTimeSeries)
# Filter for all labels with "SCSH"
scap <-
example_mts %>%
mts_filterMeta(communityRegion == "El Monte")
dplyr::select(scap$meta, ID, label, longitude, latitude, communityRegion)
head(scap$data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.