scales
scales copied to clipboard
Improve messaging in Range R6 classes
This suggestion is lifted over from https://github.com/tidyverse/ggplot2/issues/4258.
Briefly, train_discrete() and train_continuous() throw errors that can be hard to debug in some cases.
If https://github.com/tidyverse/ggplot2/pull/5086 is merged, that would leave responsibility over Range classes with {scales}, so that is why I'm opening this issue here.
My proposal would be that the Range classes get an optional field with a scale name or aesthetic name that can be used for communicating more informative errors. Responsibility for providing an informative field would then bounce the ball back to ggplot2.