A generalized data filter for sensor objects to
choose rows/cases where conditions are true. Multiple conditions are
combined with &
or seperated by a comma. Only rows where the condition
evaluates to TRUE are kept.Rows where the condition evaluates to NA
are dropped.
sensor_filter(sensor = NULL, ...)
sensor | An AirSensor object. |
---|---|
... | Logical predicates defined in terms of the variables in
|
A subset of the incoming sensor.
Filtering predicates are applied to the data
dataframe within
the sensor object.
library(AirSensor) twenties <- sensor_filter(example_sensor, example_sensor$data$`392a12065eb9940d_5192` < 30, example_sensor$data$`392a12065eb9940d_5192` >= 20) head(twenties$data)#> datetime 392a12065eb9940d_5192 #> 1 2018-08-15 12:00:00 24.16577 #> 2 2018-08-15 13:00:00 20.53610 #> 3 2018-08-15 14:00:00 24.97167 #> 4 2018-08-15 15:00:00 29.99222 #> 5 2018-08-15 16:00:00 27.22522 #> 6 2018-08-15 17:00:00 26.27874