naiveSearch_bin | R Documentation |
Finds the index of the bin a number belongs to using naive search.
naiveSearch_bin(arr, x)
arr |
A vector of size at least 2. |
x |
A number. Must be within the range of [ |
Finds the smallest index i
such that arr[i] <= x <= arr[i+1]
.
The index i
such that arr[i] <= x <= arr[i+1]
.
naiveSearch_bin(1:10, seq(1, 10, by=0.5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.