inverse: Invert an R operator

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/inverse.R

Description

inverse is a S3 generic method for inverting an R operator in the mathematical sense. Presently, inverses are defined for relational operators, i.e. changing > to <= etc.

Usage

1

Arguments

x

object representing an R operator

...

additional arguments

Details

Arguments will be checked against the defined list of inverses, If an entry exists, the corresponding inverse is returned.

Value

inverse returns the inverse in the same form as the x argument. Thus, if a name is provided, a name is returned. If a function is provided, a function is returned.

Author(s)

Christopher Brown

References

http://en.wikipedia.org/wiki/Inverse_mathematics.

See Also

operators especially operators(type="relational"))

Examples

1
2
3
4
5
  ## Not run: 
    inverse( as.name( '!=' ) )
    inverse( `==` )
 
## End(Not run) 

Example output

`==`
function (e1, e2)  .Primitive("!=")

operator.tools documentation built on May 1, 2019, 8 p.m.