is.operator: Utilities for operators

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

View source: R/is.operator.R

Description

These S4 Methods are utilies for working with operators. In R, operators are functions with special syntax.

Usage

1

Arguments

x

object to be tested or coerced. Can be function or name.

...

additional arguments passed to operators.

Details

is.operator tests whether the object is one of the defined operators.

can.operator tests whether the object can be coerced to an operator.

as.operator coerced the object to an operator.

Optionally, you can specify one of the that it tests for a specific type of operator. See details, below.

An operator is R function with special syntax.

( See ??operator for examples of each. )

is.operator tests whether the argumenst is an operator.

as.operator coerces x to a operator, otherwise fails.

can.operator test whether the object can be coerced to an operator.

All functions can accepts a types argument which is passed to link{operators}. By specifying one or more types, these functions test using those types only.

New operators can be "registered" using setOperator.

Value

is.operator and can.operator return logical.

as.operator returns the argument coerced to the concommitant R function.

Author(s)

Christopher Brown

See Also

operators, apropos, match.fun

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 

 ## Not run: 
   is.operator( `+` )
   is.operator( 'xyzzy' )
   is.operator( `+`, types="arithmetic" )
   is.operator( `+`, types="relational" )

   can.operator( `+` )
   can.operator( 'xyzzy' )
   can.operator( `+`, types="arithmetic" )
   can.operator( `+`, types="relational" )

   as.operator( `+` )
   as.operator( '+' )
   as.operator( as.name('+') )  
 
## End(Not run)

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