mav2: simple moving average

Description Usage Arguments Value Note Examples

View source: R/datautilities.R

Description

simple moving average

Usage

1
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

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

wadetj/timsRstuff documentation built on May 13, 2020, 3:31 a.m.