monitor_rollingMeanPlot: Create Rolling Mean Plot

Description Usage Arguments Details Note Examples

View source: R/monitor_rollingMeanPlot.R

Description

Creates a plot of individual (e.g. hourly) and rolling mean PM2.5 values for a specific monitor.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
monitor_rollingMeanPlot(
  ws_monitor,
  monitorID = NULL,
  width = 3,
  align = "center",
  data.thresh = 75,
  tlim = NULL,
  ylim = NULL,
  localTime = TRUE,
  shadedNight = FALSE,
  aqiLines = TRUE,
  gridHorizontal = FALSE,
  grid24hr = FALSE,
  grid3hr = FALSE,
  showLegend = TRUE
)

Arguments

ws_monitor

ws_monitor object

monitorID

Monitor ID for a specific monitor in the ws_monitor object (optional if only one monitor in the ws_monitor object).

width

Number of periods to average (e.g. for hourly data, width = 24 plots 24-hour rolling means).

align

Alignment of averaging window relative to point being calculated; one of "left|center|right".

data.thresh

Minimum number of valid observations required as a percent of width; NA is returned if insufficicnet valid data to calculate. mean

tlim

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

ylim

y limits for the plot.

localTime

Logical specifying whether tlim is in local time or UTC.

shadedNight

Add nighttime shading.

aqiLines

Horizontal lines indicating AQI levels.

gridHorizontal

Add dashed horizontal grid lines.

grid24hr

Add dashed grid lines at day boundaries.

grid3hr

Add dashed grid lines every 3 hours.

showLegend

Include legend in top left.

Details

Note

This function attempts to provide a 'publication ready' rolling mean plot.

Examples

1
2
3
4
5
6
library(PWFSLSmoke)

N_M <- Northwest_Megafires
Roseburg <- monitor_subset(N_M, tlim = c(20150821, 20150831),
                           monitorIDs = c("410190002_01"))
monitor_rollingMeanPlot(Roseburg, shadedNight = TRUE)

PWFSLSmoke documentation built on Nov. 23, 2021, 5:06 p.m.