bin_search: Find a value in a list using binary search Wrapper for...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Find a value in a list using binary search Wrapper for bin_search_rec

Usage

1
bin_search(l, val, start = NULL, end = NULL)

Arguments

l

A list of values

val

A value that is looked for

Value

Postition - 1 at which val must be in inserted to keep l sorted. 0 if val is smaller than the first element of l, length(l) if it is greater than the last one

Examples

1
2
3
bin_search(1:10, 2)
bin_search(1:10, 0)
bin_search(1:10, 2.5)

zimmerlab/MS-EmpiRe documentation built on Feb. 22, 2020, 7:01 p.m.