Create a time series barplot showing PM2.5 data for the given monitors. The overall plot is faceted by monitor, and each facet has two sets of columns: one for daily levels, and one for hourly levels.

The full range of data in monitor will be used unless both startdate and enddate are specified.

The timezone specified or, if timezone = NULL, that of the first monitor encountered will be used for all time axes.

monitor_ggDailyHourlyBarplot(
  monitor,
  startdate = NULL,
  enddate = NULL,
  id = NULL,
  columns = 1,
  title = NULL,
  timezone = NULL,
  xLabel = NULL,
  yLabel = NULL,
  includeLink = TRUE,
  hourlyDataType = c("nowcast", "raw", "none"),
  palette = "epa_aqi",
  includeLegendAdvice = FALSE
)

Arguments

monitor

A mts_monitor object.

startdate

Desired start date (integer or character in ymd format or POSIXct).

enddate

Desired end date (integer or character in ymd format or POSIXct).

id

Optional vector of deviceDeploymentIDs used to filter the data.

columns

Number of columns the faceted plot should have (default 1).

title

The title of the plot. Defaults to specifying the types of data present in the plot.

timezone

Olson timezone name for x-axis scale and date parsing. If NULL the timezone of the specified monitor will be used.

xLabel

The x-axis label of the plot. Defaults to years present in data.

yLabel

The y-axis label of the plot. Defaults to PM2.5.

includeLink

Option to include a link to an AQI help page at the bottom of the plot (default `TRUE`).

hourlyDataType

The type of hourly data to include in the plot. The options include "nowcast" (hourly nowcast values), "raw" (raw hourly values), or "none" (no hourly data at all) (default "nowcast").

palette

The ordered color palette used to represent each AQI category. Currently defaults to (and only accepts) "epa_aqi".

includeLegendAdvice

Option to include a third column in the legend for AQI level advice. Currently in testing (default `False`).

Value

A **ggplot** plot of the given monitors and data.

Examples