Displaying 2 results from an estimated 2 matches for "dpylr".
Did you mean:
dplyr
2024 Apr 12
1
any and all
...ue meaning "keep all" (TRUE)
or "drop all" (FALSE). If you use `any()` or `all()`, they return a
single boolean value, so you have an all-or-nothing filter in the end,
which is probably not what you want.
Note also that you do not need to use `mutate` to use `filter` (read
?dpylr::filter carefully):
```
filter(
.data = mydata,
!is.na(first.a) | !is.na(first.b),
!is.na(second.a) | !is.na(second.b),
!is.na(third.a) | !is.na(third.b)
)
```
Or you can use `base::subset()`:
```
subset(
mydata,
(!is.na(first.a) | !is.na(first.b))
& (!is.na(second.a) | !i...
2024 Apr 12
1
any and all
On 12/04/2024 3:52 p.m., avi.e.gross at gmail.com wrote:
> 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