ps_sma: Simple Moving Average

View source: R/sma.R

ps_smaR Documentation

Simple Moving Average

Description

Returns the simple moving average with a window of 2 * n.

Usage

ps_sma(x, n = 1L, na.rm = FALSE)

Arguments

x

An integer or double vector.

n

A positive integer of the window before and after each value.

na.rm

A flag indicating whether to ignore missing values when calculating the mean.

Value

A double vector.

Examples

ps_sma(1:4)

poissonconsulting/poisutils documentation built on Feb. 26, 2023, 10 a.m.