calculate the moving average of a dataseries

moving.average(x, n = 5)

Arguments

x

(vector). Vector containing the data that for which the average needs to be calculated.

n

(integer). Number of values for which the average needs to be calculated.

Value

vector. Data vector containing the averages. This vector is as long as the input (and thus contains NA's)