Learn R Programming

openair (version 0.3-13)

rollingMean: Calculate rollingMean values

Description

Calculate rollingMean values taking account of data capture thresholds

Usage

mydata <- rollingMean(mydata, pollutant = "o3", hours = 8, new.name = "rolling",
                     data.capture = 75)

Arguments

mydata
A data frame containing a date field.
pollutant
The name of a pollutant e.g. pollutant = "o3".
hours
The averaging period to use e.g. hours = 8 will generate 8-hour rollingMean values.
new.name
The name given to the new rollingMean variable. If not supplied it will create a name based on the name of the pollutant and the averaging period used.
data.capture
The data capture threshold in %. No values are calculated if data capture over the period of interest is less than this value. For example, with hours = 8 and data.capture = 75 at least 6 hours are required to calc

Warning

Note that the function currently only works with a single site.

Details

This is a utility function mostly designed to calculate rolling mean statistics relevent to some pollutant limits e.g. 8 hour rolling means for ozone and 24 hour rollingMeans for PM10.

Examples

Run this code
## rolling 8-hour mean for ozone
mydata <- rollingMean(mydata, pollutant = "o3", hours = 8, new.name =
"rollingo3", data.capture = 75)

Run the code above in your browser using DataLab