This commit addresses the unexpected behavior of if_any() and if_all() when no columns are selected. Specifically, if_any() now returns FALSE, and if_all() returns TRUE in cases where no columns match the selection criteria.
Additionally, tests have been added to ensure the correct behavior of these functions in both filter() and mutate() contexts, including the scenarios highlighted by the reprex example. This ensures that empty selections behave consistently with the logical expectations.
Fixes #7059
This commit addresses the unexpected behavior of
if_any()
andif_all()
when no columns are selected. Specifically,if_any()
now returnsFALSE
, andif_all()
returnsTRUE
in cases where no columns match the selection criteria.Additionally, tests have been added to ensure the correct behavior of these functions in both
filter()
andmutate()
contexts, including the scenarios highlighted by thereprex
example. This ensures that empty selections behave consistently with the logical expectations.