\HeaderA{Syntax}{Operator Syntax and Precedence}{Syntax}
\keyword{documentation}{Syntax}
\begin{Description}\relax
Outlines \R{} syntax and gives the precedence of operators
\end{Description}
\begin{Details}\relax
The following unary and binary operators are defined.  They are listed
in precedence groups, from highest to lowest.
\Tabular{ll}{
\code{[ [[}& indexing\\
\code{:: :::}& access variables in a name space\\
\code{\$ @}& component / slot extraction\\
\code{\textasciicircum{}}& exponentiation (right to left)\\
\code{- +}& unary minus and plus\\
\code{:}& sequence operator\\
\code{\%any\%}& special operators\\
\code{* /}& multiply, divide\\
\code{+ -}& (binary) add, subtract\\
\code{< > <= >= == !=}& ordering and comparison\\
\code{!}& negation\\
\code{\&  \&\&}& and\\
\code{| ||}& or\\
\code{\textasciitilde{}}& as in formulae\\
\code{-> ->{}>}& rightwards assignment\\
\code{=}& assignment (right to left)\\
\code{<- <{}<-}& assignment (right to left)\\
\code{?}& help (unary and binary)\\
}
Within an expression operators of equal precedence are evaluated
from left to right except where indicated.

The links in the \bold{See Also} section covers most other aspects of
the basic syntax.
\end{Details}
\begin{Note}\relax
There are substantial precedence differences between \R{} and S.  In
particular, in S \code{?} has the same precedence as (binary) \code{+ -}
and \code{\& \&\& | ||} have equal precedence.
\end{Note}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{Arithmetic}{Arithmetic}}, \code{\LinkA{Comparison}{Comparison}}, \code{\LinkA{Control}{Control}},
\code{\LinkA{Extract}{Extract}}, \code{\LinkA{Logic}{Logic}},
\code{\LinkA{NumericConstants}{NumericConstants}}, \code{\LinkA{Paren}{Paren}}, \code{\LinkA{Quotes}{Quotes}}.

The \emph{R Language Definition} manual.
\end{SeeAlso}

