Skip to content

Commit eecc450

Browse files
committed
Merge branch 'master' of github.com:tidyverse/ggplot2
2 parents 756ad7b + 2254247 commit eecc450

File tree

5 files changed

+30
-5
lines changed

5 files changed

+30
-5
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# ggplot2 2.2.1.9000
2+
To be released as 2.3.0
23

34
## Breaking changes
45

R/plot-build.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ ggplot_gtable.ggplot_built <- function(data) {
159159
plot_table <- layout$render(geom_grobs, data, theme, plot$labels)
160160

161161
# Legends
162-
position <- theme$legend.position
162+
position <- theme$legend.position %||% "right"
163163
if (length(position) == 2) {
164164
position <- "manual"
165165
}

R/plot-construction.r

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
#' # This can be useful to return from a function.
3939
#' base + list(subset(mpg, fl == "p"), geom_smooth())
4040
"+.gg" <- function(e1, e2) {
41+
if (missing(e2)) {
42+
stop("Cannot use `+.gg()` with a single argument. ",
43+
"Did you accidentally put + on a new line?",
44+
call. = FALSE)
45+
}
46+
4147
# Get the name of what was passed in as e2, and pass along so that it
4248
# can be displayed in error messages
4349
e2name <- deparse(substitute(e2))

revdep/email.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
release_date: ???
2-
rel_release_date: ???
3-
my_news_url: ???
4-
release_version: ???
1+
release_date: June 25
2+
rel_release_date: one month
3+
my_news_url: https://github.com/tidyverse/ggplot2/blob/master/NEWS.md#ggplot2-2219000
4+
release_version: 2.3.0

tests/testthat/test-error.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
context("error")
2+
3+
test_that("various misuses of +.gg (#2638)", {
4+
expect_error(
5+
{
6+
ggplot(mtcars, aes(hwy, displ))
7+
+ geom_point()
8+
},
9+
"Cannot use `+.gg()` with a single argument. Did you accidentally put + on a new line?",
10+
fixed = TRUE
11+
)
12+
13+
expect_error(
14+
geom_point() + geom_point(),
15+
"Cannot add ggproto objects together. Did you forget to add this object to a ggplot object?",
16+
fixed = TRUE
17+
)
18+
})

0 commit comments

Comments
 (0)