Bucketing data in R

后端 未结 1 779
花落未央
花落未央 2021-01-14 23:46

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

相关标签:
1条回答
  • 2021-01-15 00:43

    The cut() function is convenient for bucketing: cut(splitme,breaks=vectorwithsplits) .

    However, it looks like you're actually trying to figure out an insertion point. You need something like binary search.

    0 讨论(0)
提交回复
热议问题