mts_filterMeta {MazamaTimeSeries} | R Documentation |
General purpose metadata filtering for mts time series objects
Description
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.
Usage
mts_filterMeta(mts, ...)
Arguments
mts |
mts object. |
... |
Logical predicates defined in terms of the variables in
|
Value
A subset of the incoming mts time series object.
(A list with meta
and data
dataframes.)
Note
Filtering is done on variables in mts$meta
.
See Also
Examples
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)
[Package MazamaTimeSeries version 0.3.0 Index]