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")#> <composed> #> 1. function (x, ...) #> pluck(x, "x", .default = NULL) #> <environment: 0x55b5058d6228> #> #> 2. function(.x) !.x #> <bytecode: 0x55b5034c52c0> #> <environment: 0x55b5058c2fc0>negate(is.null)#> <composed> #> 1. function (x) #> .Primitive("is.null")(x) #> #> 2. function(.x) !.x #> <bytecode: 0x55b5034c52c0> #> <environment: 0x55b5054f7d28>negate(~ .x > 0)#> <composed> #> 1. <lambda> #> function (..., .x = ..1, .y = ..2, . = ..1) #> .x > 0 #> <environment: 0x55b505fd8078> #> attr(,"class") #> [1] "rlang_lambda_function" "function" #> #> 2. function(.x) !.x #> <bytecode: 0x55b5034c52c0> #> <environment: 0x55b5052ef760>#> [1] 5#> [1] 5#> [1] 5