Learn R Programming

AirMonitor (version 0.4.2)

monitor_dailyBarplot: 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"),
  ...
)

Value

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

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().

Examples

Run this code
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)

Run the code above in your browser using DataLab