operator.tools (version 1.4.4)

operators: Return the _names_ of defined operators.

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

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.

References

http://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

Run this code
## 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)

Run the code above in your browser using DataLab