Learn R Programming

diagis (version 0.2.3)

running_mean: Running mean

Description

Computes running mean of a vector or matrix, returning the values from each step.

Usage

running_mean(x, na.rm)

Value

A vector containing the recursive mean estimates.

Arguments

x

A numeric vector, matrix, three dimensional array, or an mcmc object from the coda package. For matrix, the mean is computed for each column, and for array the sweep is done over the third dimension.

na.rm

If TRUE, NA values in x are omitted from the computation. Default is FALSE.