From ae7deb78bc8a6e931a3d845cee6715000a1551a5 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Sun, 6 Sep 2020 12:52:51 +0900 Subject: [PATCH] Avoid "" labels with qplot() --- R/quick-plot.r | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/R/quick-plot.r b/R/quick-plot.r index ef9fa1187b..6870e69387 100644 --- a/R/quick-plot.r +++ b/R/quick-plot.r @@ -89,10 +89,19 @@ qplot <- function(x, y, ..., data, facets = NULL, margins = FALSE, if (is.null(xlab)) { - xlab <- as_label(exprs$x) + # Avoid label (#4170) + if (quo_is_missing(exprs$x)) { + xlab <- "" + } else { + xlab <- as_label(exprs$x) + } } if (is.null(ylab)) { - ylab <- as_label(exprs$y) + if (quo_is_missing(exprs$y)) { + ylab <- "" + } else { + ylab <- as_label(exprs$y) + } } if (missing(data)) {