Learn R Programming

crmPack (version 2.2.1)

h_find_interval: 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

Run this code
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)

Run the code above in your browser using DataLab