cumsum_bounded: cumsum bounded

Description Usage Arguments Value Examples

View source: R/expire_status_by_inventory.R

Description

a version of cumsum that will stay within specified boundaries

Usage

1
cumsum_bounded(v, low = 0, high = Inf)

Arguments

v

a numeric vector

low

numeric; lower bound

high

numeric; upper bound

Value

a numeric vector

Examples

1
2
3
cumsum_bounded(c(0,-1,-100,1,7,-99,1,1,1,-1), low = -50)
cumsum_bounded(c(0,-1,-100,1,7,-99,1,1,1,-1)) ## low = 0 is default
cumsum_bounded(c(0,-1,-100,1,7,-99,1,1,1,-1), high = 5)

renlund/dm documentation built on Jan. 18, 2022, 9:50 a.m.