monitor_dailyBarplot: Create daily barplot

View source: R/monitor_dailyBarplot.R

monitor_dailyBarplotR Documentation

Create daily barplot

Description

Creates a daily barplot of data from a mts_monitor object.

Reasonable defaults are chosen for annotations and plot characteristics. Users can override any defaults by passing in parameters accepted by graphics::barplot.

Usage

monitor_dailyBarplot(
  monitor = NULL,
  id = NULL,
  add = FALSE,
  addAQI = FALSE,
  palette = c("EPA", "subdued", "deuteranopia"),
  opacity = NULL,
  minHours = 18,
  dayBoundary = c("clock", "LST"),
  NAAQS = c("PM2.5_2024", "PM2.5"),
  ...
)

Arguments

monitor

mts_monitor object.

id

deviceDeploymentID for a single time series found in monitor. (Optional if monitor contains only a single time series.)

add

Logical specifying whether to add to the current plot.

addAQI

Logical specifying whether to add visual AQI decorations.

palette

Named color palette to use when adding AQI decorations.

opacity

Opacity to use for bars.

minHours

Minimum number of valid hourly records per day required to calculate statistics. Days with fewer valid records will be assigned NA.

dayBoundary

Treatment of daylight savings time: "clock" uses daylight savings time as defined in the local timezone, "LST" uses "local standard time" all year round.

NAAQS

Version of NAAQS levels to use. See Note.

...

Additional arguments to be passed to graphics::barplot().

Value

No return value. This function is called to draw an air quality daily average plot on the active graphics device.

Note

The underlying axis for this plot is not a time axis so you cannot use this function to "add" bars on top of a monitor_timeseriesPlot(). See the AirMonitorPlots package for more flexibility in plotting.

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)

layout(matrix(seq(2)))

Carmel_Valley %>% monitor_dailyBarplot()
title("(pre-2024 PM NAAQS)", line = 0)

Carmel_Valley %>% monitor_dailyBarplot(NAAQS = "PM2.5_2024")
title("(updated PM NAAQS)", line = 0)

layout(1)


AirMonitor documentation built on Sept. 27, 2024, 9:06 a.m.