From e4a23c1ec445d0554bccc199f264dca255545bfc Mon Sep 17 00:00:00 2001 From: Brenden Smith Date: Fri, 20 Dec 2024 07:35:56 -0500 Subject: [PATCH] Added logic to catch single named logical expressions --- R/filter.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/filter.R b/R/filter.R index 8d30e0d2aa..a699ff347b 100644 --- a/R/filter.R +++ b/R/filter.R @@ -154,11 +154,11 @@ check_filter <- function(dots, error_call = caller_env()) { for (i in which(named)) { quo <- dots[[i]] - - # only allow named logical vectors, anything else - # is suspicious expr <- quo_get_expr(quo) - if (!is.logical(expr)) { + + # Allow named logical vectors but catch bare + # logical values and anything else + if (!is.logical(expr) || (is.logical(expr) && length(expr) == 1)) { name <- names(dots)[i] bullets <- c( "We detected a named input.",