h_find_interval: Find Interval Numbers or Indices and Return Custom Number For...

View source: R/helpers.R

h_find_intervalR Documentation

Find Interval Numbers or Indices and Return Custom Number For 0.

Description

[Stable]

A simple wrapper of base::findInterval() function that invokes base::findInterval(), takes its output and replaces all the elements with 0 value to a custom number as specified in replacement argument.

Usage

h_find_interval(..., replacement = -Inf)

Arguments

...

further arguments passed to base::findInterval() function.

replacement

(number)
a custom number to be used as a replacement for 0. Default to -Inf.

Examples

h_find_interval(1, c(2, 4, 6))
h_find_interval(3, c(2, 4, 6))
h_find_interval(1, c(2, 4, 6), replacement = -1)

crmPack documentation built on July 5, 2026, 9:06 a.m.