Learn R Programming

operator.tools (version 1.3.0)

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

Value

  • character vector of unique operator names.

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.

R-core operators by type are: rl{ namespace :: ::: component @ $ indexing [ [[ sequence : arithmetic + - * / ^ %% %/% relational < > <=>= == != %in% %!in% logical ! & && | || tilde ~ assignment <- <<- -=""> ->> = help ? }

See Syntax.

types may also be one a special operator groupings:

  • REG(ISTERED): (Default). Those registered bysetOperators
  • UNREG(ISTERED): Unregisted operators, requires expensive search.
  • ALL: All operators, requires expensive search of environments.
  • SPECIAL: All operators defined using the%any%syntax.

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
operators()
  operators( types="arithmetic" )
  operators( types=c("arithmetic","logical" ) )
  operators( types='ALL' )
  operators( types='REG' )
  operators( types='UNREG' )
  operators( types='SPECIAL' )

Run the code above in your browser using DataLab