pat_filter: General purpose data filtering for _pat_ time series objects

View source: R/pat_filter.R

pat_filterR Documentation

General purpose data filtering for pat time series objects

Description

A generalized data filter for pat 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 pat object is passed in, it is immediately returned, allowing for multiple filtering steps to be piped together and only checking for an empty pat object at the end of the pipeline.

Usage

pat_filter(pat, ...)

Arguments

pat

pat object.

...

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

Value

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

Note

Filtering is done on values in pat$data.

See Also

pat_filterDate

pat_filterDatetime

Examples


library(AirSensor2)

# Unhealthy values
example_pat %>%
  pat_filter(pm2.5_atm_a > 25, pm2.5_atm_b > 25) %>%
  pat_getData() %>%
  head()


MazamaScience/AirSensor2 documentation built on Oct. 31, 2024, 1:39 a.m.