Repository navigation
Deprecate geom_errorbarh() - #5961
Merged
Merged
Conversation
thomasp85
reviewed
Sep 13, 2024
| #' @format NULL | ||
| #' @usage NULL | ||
| #' @export | ||
| GeomErrorbarh <- ggproto("GeomErrorbarh", GeomErrorbar) |
Member
There was a problem hiding this comment.
Couldn't we throw in a deprecation warning in setup_param() and see how that works?
If we give it the same ID as the one in the constructor we can ensure it only fires once for those that uses the constructor
Collaborator
Author
There was a problem hiding this comment.
Yeah works great:
devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2
df <- data.frame(
trt = factor(c(1, 1, 2, 2)),
resp = c(1, 5, 3, 4),
group = factor(c(1, 2, 1, 2)),
upper = c(1.1, 5.3, 3.3, 4.2),
lower = c(0.8, 4.6, 2.4, 3.6)
)
ggplot(df, aes(resp, trt, colour = group)) +
layer(
geom = "errorbarh",
stat = "identity",
position = "identity",
mapping = aes(xmin = lower, xmax = upper),
params = list(width = 0.2, na.rm = FALSE, orientation = NA)
)
#> Warning: `geom_errobarh()` was deprecated in ggplot2 3.5.2.
#> ℹ Please use the `orientation` argument of `geom_errorbar()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.ggplot(df, aes(resp, trt, colour = group)) +
geom_errorbarh(aes(xmin = lower, xmax = upper))Created on 2024-09-13 with reprex v2.1.1
Merge branch 'main' into deprecate_errorbarh # Conflicts: # R/geom-errorbarh.R # man/geom_errorbarh.Rd
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This PR aims to fix #3506 (comment).
Briefly,
geom_errorbarh()is nowgeom_errorbar(orientation = "y")+ deprecation warning. The<GeomErrorbarh>ggproto class is kept as people have extended it (see e.g. here), but it is just a copy of<GeomErrorbar>. It also suffers from #3798 in that we don't really have a deprecation process for ggproto classes in place.