mav2: simple moving average

View source: R/datautilities.R

mav2R Documentation

simple moving average

Description

simple moving average

Usage

mav2(dat, lagdat, fill = FALSE)

Arguments

dat

A numeric vector

lagdat

number of lags for moving average

fill

if TRUE fills in NAs to create of vector of original length (default FALSE)

Value

A numeric vector of length length(dat)-(lagdat+1), or length(dat)

Note

presently cannot handle NA or missing data

Examples

x<-c(1:100)
mav2(x, 5)
mav2(x, 10, fill=TRUE)

wadetj/timsRstuff documentation built on April 24, 2023, 7:42 a.m.