negate {purrr} | R Documentation |
Negate a predicate function.
negate(.p)
.p |
A single predicate function, a formula describing such a
predicate function, or a logical vector of the same length as |
A new predicate function.
negate("x")
negate(is.null)
negate(~ .x > 0)
x <- transpose(list(x = 1:10, y = rbernoulli(10)))
x %>% keep("y") %>% length()
x %>% keep(negate("y")) %>% length()
# Same as
x %>% discard("y") %>% length()