rollmean: Gaussian smoothing

Description Usage Arguments Value Examples

View source: R/rollmean.R

Description

Gaussian smoothing

Usage

1
rollmean(x, size)

Arguments

x

Numeric vector.

size

Radius of the smoothing (smaller than half of the length of x). If using size = 0, it returns x.

Value

Numeric vector of the same length as x, smoothed.

Examples

1
2
(x <- rnorm(10))
rollmean(x, 3)

Example output

 [1] -0.04553532  0.94946235 -0.40341268 -1.17089083  0.67197676  0.91645051
 [7]  0.04907561  0.38594311  0.16587056  1.31997741
 [1] 0.027846651 0.009162764 0.038133123 0.062343662 0.149499065 0.194136306
 [7] 0.373655837 0.514008277 0.543652143 0.589790244

bigutilsr documentation built on April 14, 2021, 1:06 a.m.