This help topic is for R version 1.5.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/Syntax.html
Syntax {base}R Documentation

Operator Syntax

Description

Outlines R syntax and gives the precedence of operators

Details

The following unary and binary operators are defined. They are listed in precedence groups, from highest to lowest.

[ [[ indexing
$ @ component / slot extraction
^ exponentiation (right to left)
- + unary minus and plus
: sequence operator
%any% special operators
* / multiply, divide
+ - (binary) add, subtract
< > <= >= == != ordering and comparison
! negation
& && and
| || or
~ as in formulae
-> ->> rightwards assignment
= assignment (right to left)
<- _ <<- assignment (right to left)
? help (unary and binary)

Within an expression operators of equal precedence are evaluated from left to right except where indicated.

The links in the See Also section covers most other aspects of the basic syntax.

Note

There are substantial precedence differences between R and S. In particular, in S ? has the same precedence as + - and & && | || have equal precedence.

See Also

Arithmetic, Comparison, Control, Extract, Logic, Paren

The R Language Definition manual.


[Package base version 1.5.0 ]