Skip to content

Commit 7edf118

Browse files
committed
try to prevent cyclical +
1 parent 838b447 commit 7edf118

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ export(StatSummaryBin)
268268
export(StatSummaryHex)
269269
export(StatUnique)
270270
export(StatYdensity)
271+
export(add_gg)
271272
export(aes)
272273
export(aes_)
273274
export(aes_all)

R/plot-construction.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#' @param e2 A plot component, as described below.
2626
#' @seealso [theme()]
2727
#' @rdname gg-add
28+
#' @export
2829
#' @examples
2930
#' base <-
3031
#' ggplot(mpg, aes(displ, hwy)) +
@@ -78,12 +79,10 @@ S7::method(`+`, list(class_theme, S7::class_any)) <- function(e1, e2) {
7879
#' @rdname gg-add
7980
#' @export
8081
"%+%" <- function(e1, e2) {
81-
if (getRversion() < "4.3.0") {
82-
add_gg(e1, e2)
83-
} else {
82+
if (getRversion() >= "4.3.0") {
8483
deprecate_soft0("4.0.0", I("<ggplot> %+% x"), I("<ggplot> + x"))
85-
`+`(e1, e2)
8684
}
85+
agg_gg(e1, e2)
8786
}
8887

8988
add_ggplot <- function(p, object, objectname) {

R/plot.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ ggplot.default <-
136136
p
137137
}
138138

139+
#' @export
139140
ggplot.function <- function(data, ...) {
140141
# Added to avoid functions end in ggplot.default
141142
cli::cli_abort(c(

0 commit comments

Comments
 (0)