cumsum_reset: Perform a cumulative sum resetting to zero whenever a 'reset'...

View source: R/math_helpers.R

cumsum_resetR Documentation

Perform a cumulative sum resetting to zero whenever a reset value is found.

Description

Perform a cumulative sum resetting to zero whenever a reset value is found.

Usage

cumsum_reset(x, reset = NA)

Arguments

x

The vector to sum over

reset

The value when found in x to reset the sum to zero at. (Note that the value at x %in% reset is zero.

Value

A vector the same length as x


billdenney/bsd.report documentation built on Jan. 16, 2024, 12:54 a.m.