Learn R Programming

MazamaTimeSeries (version 0.3.0)

mts_filterMeta: 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, ...)

Value

A subset of the incoming mts time series object. (A list with meta and data dataframes.)

Arguments

mts

mts object.

...

Logical predicates defined in terms of the variables in mts$meta.

See Also

mts_filterData

Examples

Run this code
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)

Run the code above in your browser using DataLab