twa: Calculate a time weighted average concentration

Description Usage Arguments See Also Examples

View source: R/twa.R

Description

The moving average is built only using the values in the past, so the earliest possible time for the maximum in the time series returned is after one window has passed.

Usage

1
2
3
4
twa(x, window = 21)

## S3 method for class 'one_box'
twa(x, window = 21)

Arguments

x

An object of type one_box

window

The size of the moving window

See Also

max_twa

Examples

1
2
3
pred <- sawtooth(one_box(10),
  applications = data.frame(time = c(0, 7), amount = c(1, 1)))
max_twa(pred)

jranke/pfm documentation built on Feb. 11, 2019, 9:11 a.m.