movav: Moving average of a vector

Description Usage Arguments Examples

View source: R/movav.R

Description

Calculates the moving average of a vector.

Usage

1
movav(x, n = 52, na.rm = TRUE, na.start = FALSE)

Arguments

x

A numeric vector.

n

Number of values to average.

na.rm

A logical. Whether or not to treat NAs as 0.

na.start

Whether starting elements without enough values to average should calculate to NA. Default is FALSE.

Examples

1
movav(runif(100))

wkostelecki/wtils documentation built on May 29, 2019, 2:29 p.m.