Skip to content

Commit d4b3328

Browse files
yutannihilationthomasp85
authored andcommitted
Fix #3467 Keep missingness of qplot() to label axis nicely (#3473)
1 parent b5e3494 commit d4b3328

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/quick-plot.r

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,14 @@ qplot <- function(x, y, ..., data, facets = NULL, margins = FALSE,
7171
if (!missing(position)) warning("`position` is deprecated", call. = FALSE)
7272
if (!is.character(geom)) stop("`geom` must be a character vector", call. = FALSE)
7373

74-
exprs <- enquos(x = x, y = y, ..., .ignore_empty = "all")
74+
exprs <- enquos(x = x, y = y, ...)
75+
is_missing <- vapply(exprs, quo_is_missing, logical(1))
7576
# treat arguments as regular parameters if they are wrapped into I() or
7677
# if they don't have a name that is in the list of all aesthetics
7778
is_constant <- (!names(exprs) %in% ggplot_global$all_aesthetics) |
7879
vapply(exprs, quo_is_call, logical(1), name = "I")
7980

80-
mapping <- new_aes(exprs[!is_constant], env = parent.frame())
81+
mapping <- new_aes(exprs[!is_missing & !is_constant], env = parent.frame())
8182

8283
consts <- exprs[is_constant]
8384

0 commit comments

Comments
 (0)