You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using breaks_width(1) to label count data, where we don't really want breaks that aren't whole numbers (or, more generally, integers). It works well except when the number of breaks can be very large. In those cases it would be very useful to have something that dynamically picks breaks but guarantees they are integers.
Something like breaks_extended(Q = c(1, 5, 2, 4, 3)), which is breaks_extended with the value 2.5 omitted from its default value of Q, works pretty well, except it will still generate non-integer values if the range of data is small.
I prototyped a variant based on breaks_extended() that uses this Q value but also filters out non-integer values, and as a final last-ditch effort just uses the rounded range of the data:
I've been using
breaks_width(1)
to label count data, where we don't really want breaks that aren't whole numbers (or, more generally, integers). It works well except when the number of breaks can be very large. In those cases it would be very useful to have something that dynamically picks breaks but guarantees they are integers.Something like
breaks_extended(Q = c(1, 5, 2, 4, 3))
, which isbreaks_extended
with the value2.5
omitted from its default value ofQ
, works pretty well, except it will still generate non-integer values if the range of data is small.I prototyped a variant based on
breaks_extended()
that uses thisQ
value but also filters out non-integer values, and as a final last-ditch effort just uses the rounded range of the data:Happy to open a PR if this would be useful.
The text was updated successfully, but these errors were encountered: