Skip to content

Commit 926f290

Browse files
authored
Deprecate geom_errorbarh() (#5961)
* copy `geom-errorbarh.R` contents into `geom-errorbar.R` file * rewire `geom_errorbarh()` via `geom_errorbar(orientation = "y")` * <GeomErrorbarh> is copy of <GeomErrorbar> * document `geom_errorbarh()` as deprecated along with rest of interval geoms * throw deprecation warnings * excuse `geom_errorbarh()` from test * document * fix mistakes in passing args * Let `GeomErrorbarh` throw deprecation message with same `id` * test for deprecation messages
1 parent e67bf20 commit 926f290

9 files changed

+97
-262
lines changed

Diff for: DESCRIPTION

-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ Collate:
151151
'geom-density2d.R'
152152
'geom-dotplot.R'
153153
'geom-errorbar.R'
154-
'geom-errorbarh.R'
155154
'geom-freqpoly.R'
156155
'geom-function.R'
157156
'geom-hex.R'

Diff for: R/geom-errorbar.R

+44
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,35 @@ geom_errorbar <- function(mapping = NULL, data = NULL,
2323
)
2424
}
2525

26+
#' @export
27+
#' @rdname geom_linerange
28+
#' @note
29+
#' `geom_errorbarh()` is `r lifecycle::badge("deprecated")`. Use
30+
#' `geom_errorbar(orientation = "y")` instead.
31+
geom_errorbarh <- function(mapping = NULL, data = NULL,
32+
stat = "identity", position = "identity",
33+
...,
34+
orientation = "y",
35+
na.rm = FALSE,
36+
show.legend = NA,
37+
inherit.aes = TRUE) {
38+
deprecate_soft0(
39+
"3.5.2", "geom_errobarh()", "geom_errorbar(orientation = \"y\")",
40+
id = "no-more-errorbarh"
41+
)
42+
geom_errorbar(
43+
mapping = mapping,
44+
data = data,
45+
stat = stat,
46+
position = position,
47+
...,
48+
orientation = orientation,
49+
na.rm = na.rm,
50+
show.legend = show.legend,
51+
inherit.aes = inherit.aes
52+
)
53+
}
54+
2655
#' @rdname ggplot2-ggproto
2756
#' @format NULL
2857
#' @usage NULL
@@ -80,3 +109,18 @@ GeomErrorbar <- ggproto("GeomErrorbar", Geom,
80109

81110
rename_size = TRUE
82111
)
112+
113+
#' @rdname ggplot2-ggproto
114+
#' @format NULL
115+
#' @usage NULL
116+
#' @export
117+
GeomErrorbarh <- ggproto(
118+
"GeomErrorbarh", GeomErrorbar,
119+
setup_params = function(data, params) {
120+
deprecate_soft0(
121+
"3.5.2", "geom_errobarh()", "geom_errorbar(orientation = \"y\")",
122+
id = "no-more-errorbarh"
123+
)
124+
GeomLinerange$setup_params(data, params)
125+
}
126+
)

Diff for: R/geom-errorbarh.R

-91
This file was deleted.

Diff for: R/geom-linerange.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
#' `geom_pointrange()`.
1212
#' @seealso
1313
#' [stat_summary()] for examples of these guys in use,
14-
#' [geom_smooth()] for continuous analogue,
15-
#' [geom_errorbarh()] for a horizontal error bar.
14+
#' [geom_smooth()] for continuous analogue
1615
#' @export
1716
#' @inheritParams layer
1817
#' @inheritParams geom_bar

Diff for: man/geom_errorbarh.Rd

-147
This file was deleted.

Diff for: man/geom_linerange.Rd

+18-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)