-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Check for occurence of infinite values #1703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
self$trans$transform(x) | ||
new_x <- self$trans$transform(x) | ||
if (any(is.finite(x) != is.finite(new_x))) { | ||
warning("Transformation introduced infinite values", call. = FALSE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you include the name of the scale in the warning?
Added a mention of the scale that throws the warning, but currently all positional scales are called either Don't know if this will confuse more than needed? |
Can you determine "x" vs "y" from the scale object? That would be more useful |
I can look in the aesthetics fields, but I would rather change the constructors to assigning different names to x and y scales e.g. looking in |
Using the first aesthetic should be fine. We can fix up later as part of #1312 |
How about this? The resulting warning message will be of the form:
|
Sounds good. Just needs a bullet in NEWS |
And a unit test or two |
squash and merge? |
LGTM |
Add scale name to warning Clean up warning
8cd7cf4
to
27f97d8
Compare
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/ |
This change will issue a warning if a transform results in the occurrence of new infinite values. Fixes #1696