ma: Moving Average

Description Usage Arguments Details Value Author(s) See Also

View source: R/ares.r

Description

Compute simple moving average of a variable.

Usage

1
ma(var, begin, end, selection = TRUE)

Arguments

var

variable to average

begin

initial index

end

final index

selection

a logical indicating whether .ares.selection should honoured

Details

This function is used mainly to compute accumulated exposure to meteorological factors and/or pollutants. The arguments begin and end control the window size for simple moving average computation, for instance, if one sets this parameters to 0 and 2 respectively, the resulting averages will be based on the concurrent day and the two previous days.

The function may be used inside a model formula to estimate the accumulated exposure effects.

Value

Return var averaged and if .ares.selection is set, averaged var is cut accordingly.

Author(s)

Washington Junger wjunger@ims.uerj.br and Antonio Ponce de Leon ponce@ims.uerj.br

See Also

mean,setup


wjunger/ares documentation built on Dec. 23, 2021, 5:17 p.m.