-
Notifications
You must be signed in to change notification settings - Fork 105
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
Feature request: Inert out-of-bounds function #255
Comments
This sounds like a good idea to me. Just needs a better name. |
Those both seem better than " To add a few suggestions: " |
The package purrr has a function |
If we add more functions, I think we need a common prefix, i.e. |
@hadley In this case, would you rename the existing functions? Add versions with |
Yeah, rename the old ones and just keep around. I doubt it's worth the hassle to deprecate them. |
@teunbrand Do you want to amend your PR accordingly? Call your function |
Yes, this sounds like a good idea. I'll adapt the PR. |
I've prefixed the Would it be worth adding a |
I think adding a |
Alright, the tags are added. Also, I took the liberty of adding a news bullet in case it was needed. |
Closed via #258. |
I think it might be useful to have an out-of-bounds function similar to
censor()
,squish()
andsquish_infite()
that does nothing to the data. The function can be very simple and trivial (probably could use a better name though):It is very similar to
base::identity
andbase::force
but these don't take additional arguments and raise errors when used asoob
-arguments in ggplot2. I'm sure a function like this must exist somewhere, but maybe my R vocabulary isn't large enough.The use case for this in the ggplot2 package, would be to achieve the same what the coordinate limits do to the plot.
To demonstrate this, notice that the following plots are equivalent:
I've seen on quite a number of stack overflow posts that people are confused why they must use the coordinate limits and not the scale limits or can't figure out why their barplots dissappear when the lower-limit on y is > 0 (for example: https://stackoverflow.com/questions/58954151/problems-adapting-the-y-axis-to-2x2-anova-bargraph-using-r-and-ggplot/)
Formalising this behaviour of the scale limits as a function might help people better understand that not touching the data is a valid option for axis limits too.
If this function already exists somewhere, maybe it might be best to ignore this issue and I should ask the people at ggplot2 whether they would consider to document this use somewhere.
Thank you for taking the time to read!
The text was updated successfully, but these errors were encountered: