slidSmooth: A moving average smoother

Description Usage Arguments Value Author(s) Examples

View source: R/slidPlot.R

Description

Calculates moving average smoother

Usage

1

Arguments

x

input vector

k

The moving average window size. Must be an integer value greater than 0, and no larger than length(y).

Value

Vector with same length as input y

Author(s)

Sander Bollen

Examples

1
2
3
4
5
6
7
8
9
#generate piecewise vector with gaussian noise
y <- 1:450
y[1:150] <- 2
y[151:300] <- 3
y[301:450] <- 1
y <- y + rnorm(450)

#calculate smoother
y_smooth <- slidSmooth(y,20)

CAFE documentation built on Nov. 8, 2020, 7:44 p.m.