divide a range of values in bins of equal length: cut vs cut2
问题 I'm using the cut function to split my data in equal bins, it does the job but I'm not happy with the way it returns the values. What I need is the center of the bin not the upper and lower ends. I've also tried to use cut2{Hmisc}, this gives me the center of each bins, but it divides the range of data in bins that contains the same numbers of observations, rather than being of the same length. Does anyone have a solution to this? 回答1: It's not too hard to make the breaks and labels yourself,