\HeaderA{Colon}{Colon Operator}{Colon}
\aliasA{:}{Colon}{:}
\aliasA{colon}{Colon}{colon}
\keyword{manip}{Colon}
\begin{Description}\relax
Generate regular sequences.
\end{Description}
\begin{Usage}
\begin{verbatim}
from:to
   a:b
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{from}] starting value of sequence.
\item[\code{to}] (maximal) end value of the sequence.
\item[\code{a, b}] \code{\LinkA{factor}{factor}}s of same length.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The binary operator \code{:} has two meanings: for factors \code{a:b} is
equivalent to \code{\LinkA{interaction}{interaction}(a, b)} (but the levels are
ordered and labelled differently).

For numeric arguments \code{from:to} is equivalent to \code{seq(from, to)},
and generates a sequence from \code{from} to \code{to} in steps of \code{1}
or \code{1-}.  Value \code{to} will be included if it differs from
\code{from} by an integer up to a numeric fuzz of about \code{1e-7}.
\end{Details}
\begin{Value}
For numeric arguments, a numeric vector.  This will be of type
\code{\LinkA{integer}{integer}} if \code{from} and \code{to} are both integers
and representable in the integer type, otherwise of type
\code{\LinkA{numeric}{numeric}}.

For factors, an unordered factor with levels labelled as \code{la:lb}
and ordered lexicographically (that is, \code{lb} varies fastest).
\end{Value}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.\\
(for numeric arguments: S does not have \code{:} for factors.)
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{seq}{seq}}.

As an alternative to using \code{:} for factors, \code{\LinkA{interaction}{interaction}}.

For \code{:} used in the formal representation of an interaction, see 
\code{\LinkA{formula}{formula}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
1:4
pi:6 # real
6:pi # integer

f1 <- gl(2,3); f1
f2 <- gl(3,2); f2
f1:f2 # a factor, the "cross"  f1 x f2
\end{ExampleCode}
\end{Examples}

