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")#> function (x, ...) #> { #> !pluck(x, "x", .default = NULL) #> } #> <environment: 0x75248e0>negate(is.null)#> function (x) #> { #> !.Primitive("is.null")(x) #> }negate(~ .x > 0)#> function (..., .x = ..1, .y = ..2, . = ..1) #> { #> !.x > 0 #> } #> <environment: 0x8084db0>#> [1] 3#> [1] 7#> [1] 7