Skip to content

Commit 5331072

Browse files
committed
tidyverse#4173 lambda functions in discrete scales & facets
1 parent f16a15b commit 5331072

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

R/labeller.r

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,10 @@ labeller <- function(..., .rows = NULL, .cols = NULL,
430430

431431
dots <- list(...)
432432

433-
first_dot <- dots[[1]]
434-
435-
if (is.formula(first_dot) || is.function(first_dot)) {
436-
return(as_labeller(first_dot))
433+
if (length(dots) == 1) {
434+
if (is.formula(dots[[1]]) || is.function(dots[[1]]) && !is_labeller(dots[[1]])) {
435+
return(as_labeller(dots[[1]]))
436+
}
437437
}
438438

439439
.default <- as_labeller(.default)

0 commit comments

Comments
 (0)