accumulate_threshold: Accumulate vector based on conditional threshold

View source: R/RcppExports.R

accumulate_thresholdR Documentation

Accumulate vector based on conditional threshold

Description

The vector will accumulate each pair of adjacent elements, similar to Reduce with the accumulate parameter. If the summation of the two elements is greater than the threshold, the returned value of that cycle is zero. Primary use is within assign_episode function to provide a speed boost in the looping procedure.

Usage

accumulate_threshold(x, threshold)

Arguments

x

Numeric vector.

threshold

Integer value.

Value

Numeric vector.


al-obrien/farrago documentation built on April 14, 2023, 6:20 p.m.