Learn R Programming

pvar (version 1.0.6)

MovingSum: Moving sum

Description

The filter of moving sum.

Usage

MovingSum(x, n = 2)

Arguments

x
a numeric vector.
n
a number indicating the size of moving window.

Value

  • The numeric vector.

See Also

filter

Examples

Run this code
MovingSum(1:5)	# the results: 3  5  7  9

Run the code above in your browser using DataLab