Learn R Programming

RespirAnalyzer (version 1.0.2)

MovingAverage: Function to calculate Moving Average of a series

Description

function to calculate Moving Average of a series

Usage

MovingAverage(y, W)

Value

A new numeric vector after calculate the moving average.

Arguments

y

a numeric vector, with respiratory data for a regularly spaced time series.

W

a Positive integer, the windows of Moving Average.

References

Zhang T, Dong X, Chen C, Wang D, Zhang XD. RespirAnalyzer: an R package for continuous monitoring of respiratory signals.

Examples

Run this code
data("TestData")
W <- 50
y <- MovingAverage(Data[,2],W)

Run the code above in your browser using DataLab