Creates a table of AQI category vs monitoring site with a count of the number of times each AQI category was experienced at each site. The count will be a count of hours or days depending on averaging period of the incoming monitor object.

When siteIdentifier is used, the identifiers must be in the same order as monitor$meta.

monitor_toAQCTable(
  monitor,
  NAAQS = c("PM2.5_2024", "PM2.5"),
  siteIdentifier = "locationName"
)

Arguments

monitor

mts_monitor object.

NAAQS

Version of NAAQS levels to use. See Note.

siteIdentifier

Metadata column used to identify sites or a character vector with site identifiers.

Value

Table of AQI category counts.

Note

On February 7, 2024, EPA strengthened the National Ambient Air Quality Standards for Particulate Matter (PM NAAQS) to protect millions of Americans from harmful and costly health impacts, such as heart attacks and premature death. Particle or soot pollution is one of the most dangerous forms of air pollution, and an extensive body of science links it to a range of serious and sometimes deadly illnesses. EPA is setting the level of the primary (health-based) annual PM2.5 standard at 9.0 micrograms per cubic meter to provide increased public health protection, consistent with the available health science. See PM NAAQS update.

Examples

library(AirMonitor)

# Lane County, Oregon AQSIDs all begin with "41039"
LaneCounty <-
  NW_Megafires %>%
  monitor_filter(stringr::str_detect(AQSID, '^41039')) %>%
  monitor_filterDate(20150801, 20150901)

# Count of hours each site spent in each AQ category in August
LaneCounty %>%
  monitor_toAQCTable()
#>                                  Good Moderate USG Unhealthy Very Unhealthy
#> Eugene - Hwy 99 (E99)             576      132   5        12             13
#> Eugene - Amazon Park (Eap)        586      110  19        13             16
#> Eugene  Wilkes Drive              581      124   9        10             12
#> Springfield - City Hall           566      138  13        16             11
#> Oakridge - (Oak)                  491      209  19        25              0
#> Cottage Grove - City Shops (Cgc)  538      161  15        13             17
#>                                  Hazardous Missing
#> Eugene - Hwy 99 (E99)                    6       0
#> Eugene - Amazon Park (Eap)               0       0
#> Eugene  Wilkes Drive                     8       0
#> Springfield - City Hall                  0       0
#> Oakridge - (Oak)                         0       0
#> Cottage Grove - City Shops (Cgc)         0       0

# Count of days each site spent in each AQ
LaneCounty %>%
  monitor_dailyStatistic(mean) %>%
  monitor_toAQCTable()
#>                                  Good Moderate USG Unhealthy Very Unhealthy
#> Eugene - Hwy 99 (E99)              24        5   0         1              1
#> Eugene - Amazon Park (Eap)         23        6   0         2              0
#> Eugene  Wilkes Drive               23        6   0         1              1
#> Springfield - City Hall            23        6   0         2              0
#> Oakridge - (Oak)                   20        9   1         1              0
#> Cottage Grove - City Shops (Cgc)   19       10   1         1              0
#>                                  Hazardous Missing
#> Eugene - Hwy 99 (E99)                    0       0
#> Eugene - Amazon Park (Eap)               0       0
#> Eugene  Wilkes Drive                     0       0
#> Springfield - City Hall                  0       0
#> Oakridge - (Oak)                         0       0
#> Cottage Grove - City Shops (Cgc)         0       0

# Count of days each site spent in each AQ (simplified names)
siteNames <- c(
  "Eugene 1", "Eugene 2", "Eugene 3",
  "Springfield", "Oakridge", "Cottage Grove"
)
LaneCounty %>%
  monitor_dailyStatistic(mean) %>%
  monitor_toAQCTable(siteIdentifier = siteNames)
#>               Good Moderate USG Unhealthy Very Unhealthy Hazardous Missing
#> Eugene 1        24        5   0         1              1         0       0
#> Eugene 2        23        6   0         2              0         0       0
#> Eugene 3        23        6   0         1              1         0       0
#> Springfield     23        6   0         2              0         0       0
#> Oakridge        20        9   1         1              0         0       0
#> Cottage Grove   19       10   1         1              0         0       0

# Count of days at each AQ level with the new, 2024 NAAQS
LaneCounty %>%
  monitor_dailyStatistic(mean) %>%
  monitor_toAQCTable(NAAQS = "PM2.5_2024")
#>                                  Good Moderate USG Unhealthy Very Unhealthy
#> Eugene - Hwy 99 (E99)              24        5   0         1              1
#> Eugene - Amazon Park (Eap)         23        6   0         2              0
#> Eugene  Wilkes Drive               23        6   0         1              1
#> Springfield - City Hall            23        6   0         2              0
#> Oakridge - (Oak)                   20        9   1         1              0
#> Cottage Grove - City Shops (Cgc)   19       10   1         1              0
#>                                  Hazardous Missing
#> Eugene - Hwy 99 (E99)                    0       0
#> Eugene - Amazon Park (Eap)               0       0
#> Eugene  Wilkes Drive                     0       0
#> Springfield - City Hall                  0       0
#> Oakridge - (Oak)                         0       0
#> Cottage Grove - City Shops (Cgc)         0       0