mts_filterData {MazamaTimeSeries}R Documentation

General purpose data filtering for mts time series objects

Description

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.

Usage

mts_filterData(mts, ...)

Arguments

mts

mts object.

...

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

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$data and results in an incomplete and irregular time axis.

See Also

mts_filterMeta

Examples

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)


[Package MazamaTimeSeries version 0.3.0 Index]