high.pass.moving.mean: Returns moving average(mean) of a vector where values lower...

View source: R/rutils.R

high.pass.moving.meanR Documentation

Returns moving average(mean) of a vector where values lower than a given threshold are filtered

Description

Returns moving average(mean) of a vector where values lower than a given threshold are filtered

Usage

high.pass.moving.mean(v, threshold = 0, weight = 14, na.rm = T)

Arguments

v

numeric or integer: Given vector for which the filtered moving mean is computed

threshold

numeric (scalar): value specifying the filtering threshold (default is 0)

weight

integer (scalar): Inclusion window size for computing the moving average

na.rm

logical: Should missing values be filtered? (default is TRUE)

Value

numeric (scalar): Filtered mean computed

Examples

high.pass.moving.mean(1:100, weight = 10, threshold = 95)
[1] 98
# (96 + 97 + 98 + 99 + 100)/5 = 98


genpack/gener documentation built on March 14, 2023, 9:52 a.m.