search for: if_al

Displaying 2 results from an estimated 2 matches for "if_al".

Did you mean: if_xl
2024 Apr 13
1
any and all
Hi Avi, As D?nes T?th has rightly diagnosed, you are building an "all or nothing" filter. However, you do not need to explicitly spell out all columns that you want to filter for; the "tidy" way would be to use a helper function like `if_all()` or `if_any()`. Consider this example (I hope I understand your intentions correctly): ``` library(dplyr) data <- tribble( ? ~first.a, ~first.b, ~first.c, ? 1L,????? ? 1L,?????? 0L, ? NA,?????? 1L,?????? 0L, ? 1L,??????? 0L,?????? NA, ? NA,?????? NA,?????? 1L ) ``` Let's say w...
2024 Apr 12
2
any and all
Base R has generic functions called any() and all() that I am having trouble using. It works fine when I play with it in a base R context as in: > all(any(TRUE, TRUE), any(TRUE, FALSE)) [1] TRUE > all(any(TRUE, TRUE), any(FALSE, FALSE)) [1] FALSE But in a tidyverse/dplyr environment, it returns wrong answers. Consider this example. I have data I have joined together with pairs of