: Saturday, April 13, 2024 3:17 AM
To: avi.e.gr...@gmail.com; murdoch.dun...@gmail.com; toth.de...@kogentum.hu;
r-help@r-project.org
Subject: Re: [R] 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
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
rom: Dénes Tóth
Sent: Friday, April 12, 2024 6:43 PM
To: Duncan Murdoch ; avi.e.gr...@gmail.com;
r-help@r-project.org
Subject: Re: [R] any and all
Hi Avi,
As Duncan already mentioned, a reproducible example would be helpful to
assist you better. Having said that, I think you misunderstand how
`dp
Hi Avi,
As Duncan already mentioned, a reproducible example would be helpful to
assist you better. Having said that, I think you misunderstand how
`dplyr::filter` works: it performs row-wise filtering, so the filtering
expression shall return a logical vector of the same length as the
data.fr
On 12/04/2024 3:52 p.m., avi.e.gr...@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))
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 retur
6 matches
Mail list logo