When breaks are specified to closely together, bins of width one with ugly labels result, i.e. from cut(sample(10), breaks = c(1, 4, 6, 8, 9, 10)), we get levels 1-4 5-6 7-8 9-9 10-10
Solution
Issue a warning when bins of width one are created.
change the label to the break value of the bin (e.g. to 10) instead of creating a standard label (e.g. 10-10).
Problem
When
breaks
are specified to closely together, bins of width one with ugly labels result, i.e. fromcut(sample(10), breaks = c(1, 4, 6, 8, 9, 10))
, we get levels1-4 5-6 7-8 9-9 10-10
Solution
10
) instead of creating a standard label (e.g.10-10
).