Skip to contents

function to calculate Ozone Maximum Daily 8-hr Average or 8-hr moving Average for a data.frame

Usage

hourly(
  data,
  time = "date",
  var,
  stat = mean,
  min_offset = 30,
  numerical = TRUE,
  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

stat

function of the statistics to calculate (default is mean)

min_offset

minutes of observation from previous hour (default is 30)

numerical

TRUE (default) includes only numerical columns

verbose

display additional information

Value

data.frame including only numerical columns

data.frame with time and the hourly mean, min or max

Examples

sites <- c("OAHR")
for(site in sites){
cat('downloading METAR from:',site,'...\n')
DATA <- riem::riem_measures(station    = sites,
                            date_start = "2012-01-01",
                            date_end   = "2012-02-01")
}
#> downloading METAR from: OAHR ...
data_hourly_mean <- hourly(DATA,time = 'valid')
#> processing hourly data ... 
data_hourly_min  <- hourly(DATA[1:7],time = 'valid',stat = min)
#> processing hourly data ... 
data_hourly_max  <- hourly(DATA[1:7],time = 'valid',stat = max)
#> processing hourly data ...