Skip to contents

not() is an alias for base::!. negate() is a variation of base::Negate() with an extra steps to preserve the original function and maintain the function formals.

Usage

not(x)

negate(fun)

Arguments

x

An object

fun

A function

Value

not() See base::!

negate() A function, which is the negation of fun

Details

Negate an outcome or function

Examples

identical(not(TRUE), FALSE)
#> [1] TRUE

different <- negate(identical)
different(formals(identical), formals(identical))
#> [1] FALSE