rolling_sum: Rolling Sum

Description Usage Arguments Value Note Author(s) Examples

View source: R/rolling_sum.R

Description

This function returns partial sums of the input vector.

Usage

1
rolling_sum(temp, window_l)

Arguments

temp

a vector that needs to be summed.

window_l

number of consecutive elements in temp that are summed every time.

Value

A numeric vector of length length(temp)-window_l+1 is returned.
Function will be stopped when window_l > length(temp).

Note

An NA value in x will be treat as 0 in rolling_sum(x).

Author(s)

Xiaojing Ni

Examples

1
rolling_sum(1:10, 2)

zhicongz/AnomDetct documentation built on Dec. 12, 2019, 9:16 a.m.