movav: Moving average

Description Usage Arguments Details Value

View source: R/movav.R

Description

Compute the moving average of a vector.

Usage

1
movav(x, pkg = "native", mode = "centered", n = 5, na.rm = TRUE)

Arguments

x

a numeric vector.

pkg

string: "native" (default) or the name of a package with a function that computes moving averages. Besides "native", only "zoo" is allowed (zoo::rollapply will be used). respectively.

mode

String: "centered" (default) indicates that the moving average should be centered.

Details

The resulting moving average will be of order three.

Value

A vector with the moving average of the input.


SWS-Methodology/faoswsTrade documentation built on May 4, 2018, 1:23 p.m.