I\'m trying to make a function that determines what bucket a certain value goes into based off of a given vector. So my function has two inputs: a vector determining the bre
The cut() function is convenient for bucketing: cut(splitme,breaks=vectorwithsplits) .
cut()
cut(splitme,breaks=vectorwithsplits)
However, it looks like you're actually trying to figure out an insertion point. You need something like binary search.