binary_search: Find intervals by binary search

Description Usage Arguments Value Author(s) Examples

Description

Find intervals by binary search

Usage

1
binary_search(breaks, search, left_index = TRUE)

Arguments

breaks

a non-decreasing integer vector

search

an integer vector

left_index

whether to use the index of left break or right break

Value

A vector of index.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

Examples

1
2
3
site = c(2, 5, 9, 10, 15, 20)
binary_search(site, c(1, 5, 12, 30), FALSE)
binary_search(site, c(1, 5, 12, 30), TRUE)

eilslabs/epic documentation built on May 16, 2019, 1:24 a.m.