Learn R Programming

RareVariantVis (version 1.6.2)

movingAverage: Computation of moving average

Description

Function calculates moving average from a vector of numeric values.

Usage

movingAverage(x, n, centered)

Arguments

x
a vector of numeric values for which moving average is computed
n
numeric value giving the frame length for moving average
centered
logic variable indicating if moving average should be centered (default = FALSE)

Value

comp1
function returns vector of moving average values

Examples

Run this code
movingAverage(1:20, n=3, centered=FALSE)

Run the code above in your browser using DataLab