pat_aggregateOutlierCounts: Aggregate data with count of outliers in each bin

Description Usage Arguments Value See Also Examples

View source: R/pat_aggregateOutlierCounts.R

Description

Aggregate data with count of outliers in each bin

Usage

1
2
3
4
5
6
7
pat_aggregateOutlierCounts(
  pat = NULL,
  unit = "minutes",
  count = 60,
  windowSize = 23,
  thresholdMin = 8
)

Arguments

pat

PurpleAir Timeseries pat object.

unit

Character string specifying temporal units for binning.

count

Number of units per bin.

windowSize

the size of the rolling window. Must satisfy windowSize <= count.

thresholdMin

the minimum threshold value to detect outliers via hampel filter

Value

data.frame A data.frame with flag counts per bin.

See Also

pat_aggregateData

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(AirSensor)
library(ggplot2)

df <- 
  pat_aggregateOutlierCounts(example_pat_failure_A)

# Plot the counts 
multi_ggplot(
  # A Channel
  ggplot(df, aes(x = datetime, y = pm25_A_outlierCount)) + geom_point(),
  # B Channel
  ggplot(df, aes(x = datetime, y = pm25_B_outlierCount)) + geom_point(),
  # Humidity
  ggplot(df, aes(x = datetime, y = humidity_outlierCount)) + geom_point(),
  # Temperature 
  ggplot(df, aes(x = datetime, y = temperature_outlierCount)) + geom_point()
)

AirSensor documentation built on March 13, 2021, 1:07 a.m.