mav: Compute a moving average

Description Usage Arguments Details Value

Description

Compute a moving average

Usage

1
mav(x, n)

Arguments

x

a numeric vector

n

size of the window over which to compute the moving average

Details

The function computes a weighted, centred moving average: each data point is computed as the average of the points around it, with decreasing weights as one moves away from the centre. The original data is padded on the left and on the right to be able to compute moving average values at the extremities.

Value

A numeric vector of the same length as x, with the moving average values


jiho/zooprocessr documentation built on May 19, 2019, 10:31 a.m.