monitor_timeseriesPlot: Create Timeseries Plot

Description Usage Arguments Note Examples

View source: R/monitor_timeseriesPlot.R

Description

Creates a time series plot of PM2.5 data from a ws_monitor object (see note below). Optional arguments color code by AQI index, add shading to indicate nighttime, and adjust the time display (local vs. UTC).

When a named style is used, some graphical parameters will be overridden. Available styles include:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
monitor_timeseriesPlot(
  ws_monitor,
  monitorID = NULL,
  tlim = NULL,
  localTime = TRUE,
  style = NULL,
  shadedNight = FALSE,
  add = FALSE,
  gridPos = "",
  gridCol = "black",
  gridLwd = 1,
  gridLty = "solid",
  dayLwd = 0,
  hourLwd = 0,
  hourInterval = 6,
  ...
)

Arguments

ws_monitor

ws_monitor object.

monitorID

Monitor ID for one or more monitor in the ws_monitor object.

tlim

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

localTime

Logical specifying whether tlim is in local time or UTC.

style

Custom styling, one of "aqidots".

shadedNight

Add nighttime shading.

add

Logical specifying whether to add to the current plot.

gridPos

Position of grid lines either "over", "under" ("" for no grid lines).

gridCol

Grid line color.

gridLwd

Grid line width.

gridLty

Grid line type.

dayLwd

Day marker line width.

hourLwd

Hour marker line width.

hourInterval

Interval for grid (max = 12).

...

Additional arguments to be passed to points().

Note

Remember that a ws_monitor object can contain data from more than one monitor, and thus, this function may produce a time series of data from multiple monitors. To plot a time series of an individual monitor's data, specify a single monitorID.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
library(PWFSLSmoke)

N_M <- Northwest_Megafires
# monitor_leaflet(N_M) # to identify Spokane monitorIDs
Spokane <- monitor_subsetBy(
  N_M,
  stringr::str_detect(N_M$meta$monitorID, "^53063")
)

monitor_timeseriesPlot(Spokane, style = "gnats")
title("Spokane PM2.5 values, 2015")
monitor_timeseriesPlot(
  Spokane,
  tlim = c(20150801, 20150831),
  style = "aqidots",
  pch = 16
)
addAQILegend()
title("Spokane PM2.5 values, August 2015")
monitor_timeseriesPlot(
  Spokane,
  tlim = c(20150821, 20150828),
  shadedNight = TRUE,
  style = "gnats"
)
abline(h = AQI$breaks_24, col = AQI$colors, lwd = 2)
addAQILegend()
title("Spokane PM2.5 values, August 2015")

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