monitor_dygraph: Create Interactive Time Series Plot

Description Usage Arguments Value Examples

View source: R/monitor_dygraph.R

Description

This function creates interactive graphs that will be displayed in RStudio's 'Viewer' tab.

Usage

1
2
3
4
5
6
7
8
monitor_dygraph(
  ws_monitor,
  title = "title",
  ylab = "PM2.5 Concentration",
  tlim = NULL,
  rollPeriod = 1,
  showLegend = TRUE
)

Arguments

ws_monitor

ws_monitor object

title

title text

ylab

title for the y axis

tlim

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

rollPeriod

rolling mean to be applied to the data

showLegend

logical to toggle display of the legend

Value

Initiates the interactive dygraph plot in RStudio's 'Viewer' tab.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Fail gracefully if any resources are not available
try({

library(PWFSLSmoke)

# Napa Fires -- October, 2017
ca <- airnow_load(2017) %>%
  monitor_subset(tlim=c(20171001,20171101), stateCodes='CA')

Vallejo <- monitor_subset(ca, monitorIDs='060950004_01')

Napa_Fires <- monitor_subsetByDistance(
  ca,
  longitude = Vallejo$meta$longitude,
  latitude = Vallejo$meta$latitude,
  radius = 50
)

if ( interactive() ) {
  monitor_dygraph(Napa_Fires, title='Napa Fires in California, Oct. 2017')
}

}, silent = FALSE)

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