Learn R Programming

openair (version 0.5-23)

rollingMean: Calculate rollingMean values

Description

Calculate rollingMean values taking account of data capture thresholds

Usage

rollingMean(mydata, pollutant = "o3", hours = 8,
    new.name = "rolling", data.thresh = 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.thresh
The data capture threshold in values are calculated if data capture over the period of interest is less than this value. For example, with hours = 8 and data.thresh = 75 at least 6 hours are required to calculate the me

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.thresh = 75)

Run the code above in your browser using DataLab