divide a range of values in bins of equal length: cut vs cut2
Question
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?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow