monitor_dailyBarplot: Create Daily Barplot

Description Usage Arguments Details Examples

View source: R/monitor_dailyBarplot.R

Description

Creates a bar plot showing daily average PM 2.5 values for a specific monitor in a ws_monitor object. Each bar is colored according to its AQI category.

This function is a wrapper around base::barplot and any arguments to that function may be used.

Each 'day' is the midnight-to-midnight period in the monitor local timezone. When tlim is used, it is converted to the monitor local timezone.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
monitor_dailyBarplot(
  ws_monitor,
  monitorID = NULL,
  tlim = NULL,
  minHours = 18,
  gridPos = "",
  gridCol = "black",
  gridLwd = 0.5,
  gridLty = "solid",
  labels_x_nudge = 0,
  labels_y_nudge = 0,
  ...
)

Arguments

ws_monitor

ws_monitor object

monitorID

monitor ID for a specific monitor in ws_monitor (optional if ws_monitor only has one monitor)

tlim

optional vector with start and end times (integer or character representing YYYYMMDD[HH] or POSIXct)

minHours

minimum number of valid data hours required to calculate each daily average

gridPos

position of grid lines either 'over', 'under' (” for no grid lines)

gridCol

color of grid lines (see graphical parameter 'col')

gridLwd

line width of grid lines (see graphical parameter 'lwd')

gridLty

type of grid lines (see graphical parameter 'lty')

labels_x_nudge

nudge x labels to the left

labels_y_nudge

nudge y labels down

...

additional arguments to be passed to barplot()

Details

The labels_x_nudge and labels_y_nudge can be used to tweak the date labeling. Units used are the same as those in the plot.

Examples

1
2
3
4
5
6
7
library(PWFSLSmoke)

N_M <- monitor_subset(Northwest_Megafires, tlim = c(20150715, 20150930))
main <- "Daily Average PM2.5 for Omak, WA"
monitor_dailyBarplot(N_M, monitorID = "530470013_01", main = main,
                         labels_x_nudge = 1)
addAQILegend(fill = rev(AQI$colors), pch = NULL)

PWFSLSmoke documentation built on July 8, 2020, 7:19 p.m.