sts_filter {MazamaTimeSeries} | R Documentation |
General purpose data filtering for sts time series objects
Description
A generalized data filter for sts 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 NA
are dropped.
If an empty sts object is passed in, it is immediately returned, allowing for multiple filtering steps to be piped together and only checking for an empty sts object at the end of the pipeline.
Usage
sts_filter(sts, ...)
Arguments
sts |
sts object. |
... |
Logical predicates defined in terms of the variables in
|
Value
A subset of the incoming sts
time series object.
(A list with meta
and data
dataframes.)
Note
Filtering is done on values in sts$data
.
See Also
Examples
library(MazamaTimeSeries)
unhealthy <- sts_filter(example_sts, pm25_A > 55.5, pm25_B > 55.5)
head(unhealthy$data)
[Package MazamaTimeSeries version 0.3.0 Index]