| negate {purrr} | R Documentation |
Negate a predicate function.
negate(.p, .default = FALSE)
.p |
A single predicate function, a formula describing such a
predicate function, or a logical vector of the same length as |
.default |
Optional additional argument for extractor functions
(i.e. when |
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()