find_interval: A wrapper around base::findInterval() that allows decreasing...

Description Usage Arguments Value

View source: R/misc.R

Description

When vec is in ascending order we use base::findInterval(), but when vec is in descending order we implement an adaptation of the locate() function from Numerical Recipes for C http://apps.nrbook.com/c/index.html

Usage

1
find_interval(x, vec, rightmost.closed = FALSE, all.inside = FALSE)

Arguments

x

numeric values we wish to located within vec

vec

numeric vector of sorted values (ascending or descending order) within which we wish to find the placement of x

rightmost.closed

see findInterval

all.inside

see findInterval

Value

see findInterval


BigelowLab/namanl documentation built on Nov. 15, 2021, 3:11 p.m.