aqstat.functions: Functions to calculate Air Quality indicators

Description Usage Arguments Details

Description

Functions to calculate simple statistical Air Quality indicators, also for legal purposes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
stat.period (x, period, necess,       FUN = mean)
stat.period2(x, period, nmax.missing, FUN = mean)
which.period(x, period, necess,       FUN = which.max)
exc.period  (x, period, necess,       threshold)

stat.window(x, window, necess, FUN = mean)
mean.window(x, k, necess)

detect.event(x, threshold)
aot(x, hr, threshold = 80, estimate = T, 
    hr.min = 8, hr.max = 19)

shift(x, k)

Arguments

x

vector of the concentration values

period

vector, with the same length as x, to distinguish different periods (e.g. days, months)

window

numerical vectors with two elements; defines the running window, e.g. c(-7,0) is the 8 hours window for 8hr running mean of ozone or carbon monoxide

necess

if >1, number of valid data needed in each time period. If <1, fraction of data needed in each time period.

nmax.missing

number of missing data accepted in each time period

FUN

the function to be applied

threshold

threshold

k

in shift, the number of timesteps you want to shift x; in mean.window, the width of the window

hr

numerical vector of the hours (with the same length as x)

estimate

logical. IF TRUE the AOT is corrected according to the EU legislation in order to take into account the number of missing values

hr.min

first hour of the timerange over which AOT is calculated

hr.max

last hour of the timerange over which AOT is calculated

Details

The functions stat.period and stat.period2 apply the function FUN over defined time periods, with different approaches in handling missing data. The function which.period is similar to stat.period, but you can use it for functions (such as which.min or which.max ) which do not accept the argument na.rm.

Instead stat.window operates on a floating window, and calls shift that moves the time series forward or backward in time. The function mean.window do the same and is more efficient, but limited to the moving average.

The function exc.period counts exceedances of a given threshold. Instead detect.event returns an array containing the date and time of the exceedances and their duration (expressed in number of timestep).

aot calculates Accumulated exposure Over Threshold


jobonaf/pesco documentation built on May 19, 2019, 2:58 p.m.