apply_epa: Apply EPA Corrections

Description Usage Arguments Value Source See Also Examples

View source: R/apply_epa.R

Description

Apply EPA correction factors to PurpleAir PM2.5 data. The EPA has established conditions in 2020 and late 2020 (the latter of which is tagged as "2021" in this set) for correcting PurpleAir data, including minimum data requirements and checks for A & B monitor agreement. The late 2020 correction factor includes consideration for high-PM events (such as wildfires); the low-PM values have the same correction factor as 2020. Unlike the LRAPA correction factor (apply_lrapa) which uses CF=ATM PM2.5 values, the major EPA correction factors use CF=1 values. If needed, an additional EPA-based output column using CF=ATM is included. More information on this variable can be found on the PurpleAir FAQ. More information about EPA correction factors can be found on the Air Sensor Toolbox.

Usage

1
2
3
4
5
6
7
apply_epa(
  dataset,
  by_day = TRUE,
  by_hour = FALSE,
  epa_percent = 75,
  keep_cols = FALSE
)

Arguments

dataset

The dataset for which to apply the correction factors to

by_day

Logical; average data by day

by_hour

Logical; average data by hour

epa_percent

Numeric; Minimum percentage of data required to be included

keep_cols

Logical; Keep or discard extra columns. If FALSE, only identifying columns and EPA-corrected columns will remain

Value

Dataframe with new columns for EPA-corrected PM2.5, and values removed if A & B determined to be in disagreement or minimum data requirement not met.

pm25_epa_2020

EPA-corrected PM2.5 values, calculated as 0.524 × PM2.5(CF=1) - (0.0852 × humidity) + 5.72

pm25_epa_2021

EPA-corrected PM2.5 values, calculated as:

  • The 2020 equation (see pm25_epa_2020 description) if PM2.5(CF=1) ≤ 343 µg/m^3

  • 0.46 × PM2.5(CF=1) + (3.93 × 10^(-4) × PM2.5(CF=1)^2) + 2.97 for PM2.5(CF=1) > 343 µg/m^3

pm25_epa_atm

EPA-corrected PM2.5 values, calculated as:

  • 0.25 × PM2.5(CF=ATM) - 0.086 × humidity + 5.75 when PM2.5(CF=ATM) < 50

  • 0.786 × PM2.5(CF=ATM) - 0.086 × humidity + 5.75 when 50 ≤ PM2.5(CF=ATM) < 229

  • 0.69 × PM2.5(CF=ATM) + 8.84 × 10^(-4) × PM2.5(CF=ATM)(^2) + 2.97 when PM2.5(CF=ATM) > 229

Source

EPA Air Sensor Toolbox

See Also

Other PA functions: apply_corrections(), apply_functions(), apply_lrapa(), apply_qc()

Examples

1
2
apply_epa(july_api_full)
## Not run: apply_epa(july_api_full, keep_cols = TRUE, by_hour = TRUE)

gmcginnis/AirVizR documentation built on Dec. 20, 2021, 11:49 a.m.