R/monitor_dailyThreshold.R
monitor_dailyThreshold.Rd
Calculates the number of hours per day each monitor in ws_monitor
was at or above a given threshold
monitor_dailyThreshold( ws_monitor, threshold = "unhealthy", dayStart = "midnight", minHours = 0, na.rm = TRUE )
ws_monitor | ws_monitor object |
---|---|
threshold | AQI level name (e.g. |
dayStart | one of |
minHours | minimum number of hourly observations required |
na.rm | logical value indicating whether NA values should be ignored |
A ws_monitor object with a daily count of hours at or above threshold
.
NOTE: The returned counts include values at OR ABOVE the given threshold; this applies to both categories and values.
For example, passing a threshold
argument = "unhealthy" will return a daily count of values that are unhealthy,
very unhealthy, or extreme (i.e. >= 55.5), as will passing a threshold
argument = 55.5.
AQI levels for threshold
argument = one of "good|moderate|usg|unhealthy|very unhealthy|extreme"
Sunrise and sunset times are calculated based on the first monitor encountered. This should be accurate enough for all use cases involving co-located monitors. Monitors from different regions should have daily statistics calculated separately.
The returned ws_monitor object has a daily time axis where each time is set to 00:00, local time.
library(PWFSLSmoke) N_M <- monitor_subset(Northwest_Megafires, tlim=c(20150801,20150831)) Twisp <- monitor_subset(N_M, monitorIDs='530470009_01') Twisp_daily <- monitor_dailyThreshold(Twisp, "unhealthy", dayStart='midnight', minHours=1) monitor_timeseriesPlot(Twisp_daily, type='h', lwd=6, ylab="Hours")