Skip to content

Commit 2b8022d

Browse files
authored
In qplot, treat arguments that are not in the list of possible aesthetics as parameters. Closes #2671. (#2672)
1 parent 4299917 commit 2b8022d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

R/quick-plot.r

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ qplot <- function(x, y, ..., data, facets = NULL, margins = FALSE,
7373

7474
exprs <- rlang::enquos(x = x, y = y, ...)
7575
is_missing <- vapply(exprs, rlang::quo_is_missing, logical(1))
76-
is_constant <- vapply(exprs, rlang::quo_is_call, logical(1), name = "I")
76+
# treat arguments as regular parameters if they are wrapped into I() or
77+
# if they don't have a name that is in the list of all aesthetics
78+
is_constant <- (!names(exprs) %in% .all_aesthetics) |
79+
vapply(exprs, rlang::quo_is_call, logical(1), name = "I")
7780

7881
mapping <- new_aes(exprs[!is_missing & !is_constant], env = parent.frame())
7982

0 commit comments

Comments
 (0)