Learn R Programming

eva3dm (version 0.99.1)

ma8h: 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, ...)

Value

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

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

Examples

Run this code
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'))

Run the code above in your browser using DataLab