Skip to content

Commit e4a23c1

Browse files
Brenden SmithBrenden Smith
authored andcommitted
Added logic to catch single named logical expressions
1 parent fb25640 commit e4a23c1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

R/filter.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ check_filter <- function(dots, error_call = caller_env()) {
154154

155155
for (i in which(named)) {
156156
quo <- dots[[i]]
157-
158-
# only allow named logical vectors, anything else
159-
# is suspicious
160157
expr <- quo_get_expr(quo)
161-
if (!is.logical(expr)) {
158+
159+
# Allow named logical vectors but catch bare
160+
# logical values and anything else
161+
if (!is.logical(expr) || (is.logical(expr) && length(expr) == 1)) {
162162
name <- names(dots)[i]
163163
bullets <- c(
164164
"We detected a named input.",

0 commit comments

Comments
 (0)