moving_av: Calculate moving average

View source: R/functions.R

moving_avR Documentation

Calculate moving average

Description

This function calculates a moving average of a vector for smoothing data (e.g. time series).

Usage

moving_av(x, window = 5)

Arguments

x

Vector for which to calculate moving average.

window

Width of the window for the moving average. Number of neighboring values that will be averaged at each position of x.

Examples

moving_av(x = rnorm(100), window = 5)

Jonas-Wilhelm/jwtools documentation built on April 14, 2025, 4:10 a.m.