Flexible binning of univariate arguments based on a sorted vector.
- customizable “halo” around the range or boundaries, for handling numerical error
- customizable handling of values that coincide with bin boundaries
- outside values can error or on either side
At the core, it is a trivial application of searchsortedfirst
etc. I wanted to handle corner cases and have everything tested in a package.