This function is a simple moving window function.

meanAlong(vec, n)

Arguments

vec

a vector of numeric.

n

an integer indicating the size of the window.

Examples

meanAlong(1:10, 2)
#> [1] 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 9.5