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
Discrete scales are not designed to work with numeric data, this is clear. However, a careless/naive user could attempt to apply a discrete scale to continuous data. I suggest issuing a warning when a discrete scale is applied to continuous data.
Use case: I absent-mindedly tried to apply scale_x_discrete to a continuous scale (the data was intended to be discrete, but was actually numeric) and discovered that the axis was dropped altogether and no warning issued. I hadn't noticed the problem until I used expand_scale inside the scale_x_discrete. Before that I was able to set limits inside scale_x_discrete without losing the axis, so alarm bells hadn't sounded. A warning would save time debugging and/or potentially avoid producing an incorrect plot.
The text was updated successfully, but these errors were encountered:
ptoche
changed the title
scale_x_discrete with numeric no warning + drops the axis
scale_x_discrete with numeric drops axis with no warning
Nov 6, 2018
— so it would require extremely careful analysis to determine if this was always a false positive or is actually needed for existing plots in the wild. It's my sense that this analysis would be sufficiently time consuming as not to be worthwhile, given the payoff.
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/
lockbot
locked and limited conversation to collaborators
Dec 15, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Uh oh!
There was an error while loading. Please reload this page.
Discrete scales are not designed to work with numeric data, this is clear. However, a careless/naive user could attempt to apply a discrete scale to continuous data. I suggest issuing a warning when a discrete scale is applied to continuous data.
Use case: I absent-mindedly tried to apply
scale_x_discrete
to a continuous scale (the data was intended to be discrete, but was actually numeric) and discovered that the axis was dropped altogether and no warning issued. I hadn't noticed the problem until I usedexpand_scale
inside thescale_x_discrete
. Before that I was able to set limits insidescale_x_discrete
without losing the axis, so alarm bells hadn't sounded. A warning would save time debugging and/or potentially avoid producing an incorrect plot.Created on 2018-10-30 by the reprex package (v0.2.0).
The text was updated successfully, but these errors were encountered: