Description Usage Arguments Details Value Examples
View source: R/monitor_rollingMean.R
Calculates rolling means for each monitor in ws_monitor
using the
openair::rollingMean()
function
1 2  monitor_rollingMean(ws_monitor, width = 8, data.thresh = 75,
align = "center")

ws_monitor 
ws_monitor object 
width 
number of periods to average (e.g. for hourly data, 
data.thresh 
minimum number of valid observations required as a percent of 
align 
alignment of averaging window relative to point being calculated; one of 
align = 'left'
: Forward roll, using hour of interest and the (width
1) subsequent hours
(e.g. 3hr leftaligned roll for Hr 5 will consist of average of Hrs 5, 6 and 7)
align = 'right'
: Backwards roll, using hour of interest and the (width
1) prior hours
(e.g. 3hr rightaligned roll for Hr 5 will consist of average of Hrs 3, 4 and 5)
align = 'center'
for odd width
: Average of hour of interest and (width
1)/2 on either side
(e.g. 3hr centeraligned roll for Hr 5 will consist of average of Hrs 4, 5 and 6)
align = 'center'
for even width
: Average of hour of interest and (width
/2)1 hours prior and
width
/2 hours after (e.g. 4hr centeraligned roll for Hr 5 will consist of average of Hrs 4, 5, 6 and 7)
A ws_monitor object with data thaty have been processed by a rolling mean algorithm.
1 2 3 4 5 6 7 8 9 10  N_M < Northwest_Megafires
wa_smoky < monitor_subset(N_M, stateCodes='WA', tlim=c(20150801, 20150808), vlim=c(100,Inf))
wa_smoky_3hr < monitor_rollingMean(wa_smoky, width=3, align="center")
wa_smoky_24hr < monitor_rollingMean(wa_smoky, width=24, align="right")
monitorPlot_timeseries(wa_smoky, type='l', shadedNight=TRUE)
monitorPlot_timeseries(wa_smoky_3hr, type='l', col='red', add=TRUE)
monitorPlot_timeseries(wa_smoky_24hr, type='l', col='blue', lwd=2, add=TRUE)
legend('topright', c("hourly","3hourly","24hourly"),
col=c('black','red','blue'), lwd=c(1,1,2))
title('Smoky Monitors in Washington  August, 2015')

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.