PurpleAirSoH_dailyToIndex_00: Daily state of health index

Description Usage Arguments Examples

View source: R/PurpleAirSoH_dailyToIndex_00.R

Description

This function calculates a multi-metric index based on the data in SoH dataframe passed in. A tibble is returned containing a state of health index for each day. The returned tibble contains columns: datetime, index, and index_bin.

The index column contains a value normalized between 0 and 1 where 0 represents low confidence in the sensor data and 1 represents high confidence. The index_bin is one of 1, 2, or 3 and represents poor, fair, and good data respectively.

The index is calculated in the following manner:

  1. If the A or B channel percent reporting is < minPctReporting, index = 0

  2. Otherwise, index = pm25_A_pm25_B_rsquared

The breaks are used to convert index into the indenx_bin poor-fair-good values.

Usage

1
2
3
4
5
PurpleAirSoH_dailyToIndex_00(
  SoH = NULL,
  minPctReporting = 50,
  breaks = c(0, 0.2, 0.8, 1)
)

Arguments

SoH

PurpleAir daily State-of-Health dataframe.

minPctReporting

Percent reporting threshold for A and B channels.

breaks

Breaks used to convert index values into index bins.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10

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