Learn R Programming

dateutils (version 0.1.5)

rollmean: Rolling mean

Description

Take the rolling mean of `x` over `n` elements

Usage

rollmean(x, n)

Arguments

x

data vector

n

span of rolling mean

Value

Rolling mean of the input

Examples

Run this code
# NOT RUN {
rollmean(c(1,2,3),2) ## NA, 1.5, 2.5 
# }

Run the code above in your browser using DataLab