ema: Exponential moving average filter (EMA)

View source: R/ema.R

emaR Documentation

Exponential moving average filter (EMA)

Description

This function smoothes the data using an exponential moving average filter with a specified decay.

Usage

ema(lightVar, decay, sampling_int = NULL, beta = FALSE)

Arguments

lightVar

Numeric vector containing the light data. Missing values are replaced by 0.

decay

Numeric value or string in the format "[numeric] [unit]", with possible units ("seconds","minutes","hours","days"); units can be abbreviated, see parse_timeunit_tosecs. If specified as a string, 'sampling_int' must be specified as well.

sampling_int

Numeric. Sampling interval in seconds. Must be specified if 'decay' is a string in the format "[numeric] [unit]". Defaults to NULL.

beta

Logical. Is 'decay' refering directly to beta value? If TRUE, 'decay' must be a numeric value.

Value

Numeric vector of filtered light data


steffenhartmeyer/lightdosimetry documentation built on Jan. 29, 2024, 12:48 p.m.