operators: Return the _names_ of defined operators.

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

View source: R/operators.R

Description

operators returns the names of defined operators. Argument types can be used to select operators of a specified type(s) or GROUPING(s). See Details for specifics.

Usage

1
operators(types = "REGISTERED")

Arguments

types

A character vector with the types of operators to return. The types may one or more of: 'namespace', 'component', 'indexing', 'sequence', 'arithmetic', 'relational', 'logical', 'tilde', 'assignment', 'help', 'user', or user-defined type specified in a call to setOperator. It may also be one of the special groups: 'REG(ISTERED)', 'UNREG(ISTERED)', 'SPECIAL', 'ALL'. See Details.

operators provides the names of defined operators. These can be either registered operators (using setOperators), or unregistered operators definde by the %any% syntax.

By default, only registered operators are returned. This is purely for performance reasons as an exhausting search for %any% functions is expensive.

See Syntax.for the core R operators

types may also be one a special operator groupings:

  • REG(ISTERED): (Default). Those registered by setOperators

  • UNREG(ISTERED): Unregisted operators, requires expensive search.

  • ALL: All operators, requires expensive search of environments.

  • SPECIAL: All operators defined using the %any% syntax.

Value

character vector of unique operator names.

Note

The right arrow assignment operators, -> and ->> is not an operator but a syntatic variant. Consequently, it does not behave properly as an operator. They are omitted from the operator list as they are not correctly identified as primitives or functions by the R language.

Author(s)

Christopher Brown

References

https://cran.r-project.org/doc/manuals/R-lang.html https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14310

See Also

Syntax, setOperator, setOperators, and the help files on the individial operators.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 ## Not run:  
  operators()
  operators( types="arithmetic" )
  operators( types=c("arithmetic","logical" ) )
  operators( types='ALL' )
  operators( types='REG' )
  operators( types='UNREG' )
  operators( types='SPECIAL' )
 
## End(Not run)

decisionpatterns/operator.tools documentation built on Sept. 21, 2017, 10:30 p.m.