monitor_dailyStatisticList: Calculate Daily Statistics

Description Usage Arguments Details Value References Examples

View source: R/monitor_dailyStatisticList.R

Description

Calculates daily statistics for each monitor in ws_monitor.

Usage

1
2
3
4
5
6
7
monitor_dailyStatisticList(
  ws_monitor,
  FUN = get("mean"),
  dayStart = "midnight",
  na.rm = TRUE,
  minHours = 18
)

Arguments

ws_monitor

ws_monitor object

FUN

function used to collapse a day's worth of data into a single number for each monitor in the ws_monitor object

dayStart

one of sunset|midnight|sunrise

na.rm

logical value indicating whether NA values should be ignored

minHours

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

Details

Splits the ws_monitor object by timezone and applies the monitor_dailyStatistic() function separately for each timezone. See monitor_dailyStatistic for more details.

The results are returned as a list of ws_monitor objects with each element of the list named with the associated timezone. Note that each ws_monitor$data$datetime will be in local time. This is desirable as it ensures proper date formatting in tables and plots.

You should not attempt to reassemble a single ws_monitor object from the elements in this list.

Value

A list of ws_monitor objects with daily statistics for each local timezone.

References

monitor_dailyStatistic

Examples

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

library(PWFSLSmoke)

airnow <- airnow_loadLatest()
nw <- monitor_subset(airnow, stateCodes = c('WA','OR','ID','MT'))
dailyList <- monitor_dailyStatisticList(nw)

monitor_leaflet(dailyList[["America/Los_Angeles"]])

monitor_leaflet(dailyList[["America/Boise"]])

monitor_leaflet(dailyList[["America/Denver"]])

}, silent = FALSE)

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