avg_update: Incremental average calculation

Description Usage Arguments Value

View source: R/stat.R

Description

Online algorithm for updating a given average on new value TODO: check for numerical stability

Usage

1
avg_update(avg, cnt, val, na.rm = TRUE)

Arguments

avg

The current average value

cnt

The count of elements before the new value

val

The new value

na.rm

Whether to remove NA values

Value

The updated average


henfiber/later documentation built on May 20, 2019, 6:46 p.m.