0

Is there a function or package that I can use to cut columns into ten unique buckets automatically? Currently, I'm using the quantile/decile function to do this and I'm getting the error message that the "breaks are not unique." Currently, when this happens, I then cut the column into tens by eye balling it. As you can imagine, this can be a bit time consuming. As such, is there a different way to cut the column into ten buckets without eyeballing or using the quantile/decile function? One that automatically finds the unique breaks. Overall, I'm mostly looking to automate the process of creating ten buckets as much as possible so that I can then plot data into a bar graph.

QMan5
  • 713
  • 1
  • 4
  • 20
  • 1
    The reason why its saying that the cuts are not unique is because there would be too many values of a single value (e.g 30% of the data is 0). How would you want to cut up your data in that instance? What are you trying to achieve? Do you just want to select 10 equal sized buckets (not caring about any sort of order/values?) - i.e. random sample? – sdhaus Feb 07 '20 at 14:27
  • My ultimate goal would be to have 10 buckets. I'm thinking that a random sample would work just as a preliminary test in the beginning. It might actually make eyeballing where the buckets should be in even easier. It sounds like automating this is out of question though. – QMan5 Feb 07 '20 at 14:37
  • What are you eyeballing though? If you cant make it into quantiles, then how are you deciding where the cuts are? – sdhaus Feb 07 '20 at 14:51
  • 1
    Does this answer your question? [Cut() error - 'breaks' are not unique](https://stackoverflow.com/questions/16184947/cut-error-breaks-are-not-unique) – MatthewR Feb 07 '20 at 14:53
  • This does work. It's not exactly what I'm looking for, but it's close enough. It doesn't really automate the process that much. Thanks. – QMan5 Feb 07 '20 at 15:06

0 Answers0