ma8h: Calculate 8-hour moving average

View source: R/ma8h.R

ma8hR Documentation

Calculate 8-hour moving average

Description

function to calculate Ozone 8-hour moving average for a data.frame

Usage

ma8h(data, time = "date", var, verbose = TRUE, ...)

Arguments

data

data.frame with time column and variable columns to be processed

time

name of the time column (default is date) in POSIXct

var

name of the columns to be calculated

verbose

display additional information

...

parameters passed to hourly

Value

data.frame with time and the 8-hour moving average

Examples

model_file <- paste(system.file("extdata", package = "eva3dm"),
                                "/model_o3_ugm3_36km.Rds", sep="")
model      <- readRDS(model_file)
model_8h   <- ma8h(model)
plot(model$date,model$Campinas, pch = 19,
     main = expression(O[3]~~'['*mu*g*m^-3*']'))
points(model_8h$date,model_8h$Campinas, col = 'blue', pch = 19)
legend('topleft',bty = 'n',
       pch = 19,
       legend = c('hourly','8h-mov average'),
       col = c('black','blue'))

eva3dm documentation built on April 4, 2025, 5:11 a.m.