formula.tools (version 1.5.4)

invert: invert

Description

Invert the operators in an object, usually a formula or expression

Usage

invert(x, ...)
"invert"(x)
"invert"(x)

Arguments

x
function for invert
...
additional arguments passed other functions

invert is a S4 generic method for inverting relational operators, i.e.

functions prefixed with a . are not exported and should probably not be called directly

Value

The operand is returned with the relational operators inverted.

See Also

op, op.type

Examples

Run this code
invert( quote( A >  5 ) )
  invert( quote( A >= 5 ) )
  invert( quote( A <  5 ) )
  invert( quote( A <= 5 ) )
  invert( quote( A == 5 ) )
  invert( quote( A != 5 ) )
  invert( quote( A %in% lettters[1:5] ) )
  invert( quote( A %!in% letters[1:5] ) )

Run the code above in your browser using DataCamp Workspace