\Header{seq}{Sequence Generation}
\alias{seq.default}{seq}
\alias{:}{seq}
\keyword{manip}{seq}
\begin{Usage}
\begin{verbatim}
from:to
seq(from, to)
seq(from, to, by=)
seq(from, to, length=)
seq(along)
\end{verbatim}
\end{Usage}
\begin{Description}
The \texttt{:} and the first \texttt{seq(.)} form above generate the sequence
\texttt{from, from+1}, \ldots, \texttt{to}.
\texttt{seq} is a generic function.

The second, \texttt{from, from+by}, \ldots, \texttt{to}.
The third generates a sequence of \texttt{length} equally spaced values from
\texttt{from} to \texttt{to}.
The last generates the sequence
\texttt{1, 2}, \ldots, \texttt{length(along)}.

If \texttt{from} and \texttt{to} are factors of the same length,
the ``cross'' of the two is returned.\end{Description}
\begin{Value}
The result is of \texttt{mode} \texttt{"integer"} if \texttt{from} is
(numerically equal to an) integer.\end{Value}
\begin{SeeAlso}
\texttt{\Link{rep}}, \texttt{\Link{sequence}}, \texttt{\Link{row}}, \texttt{\Link{col}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
1:4
pi:6 # float
6:pi # integer

seq(0,1, length=11)
seq(1,9, by = 2) # match
seq(1,9, by = pi)# stay below
seq(1,6, by = 3)
seq(1.575, 5.125, by=0.05)

1:4
pi:6 # float
6:pi # integer

seq(0,1, length=11)
seq(1,9, by = 2) # match
seq(1,9, by = pi)# stay below
seq(1,6, by = 3)
seq(1.575, 5.125, by=0.05)


for (x in list(NULL, letters[1:6], list(1,pi)))
  cat("x=",deparse(x),";  seq(along = x):",seq(along = x),"\n")

f1_ gl(2,3); f1
f2_ gl(3,2); f2
f1:f2 # a factor, the ``cross''  f1 x f2


for (x in list(NULL, letters[1:6], list(1,pi)))
  cat("x=",deparse(x),";  seq(along = x):",seq(along = x),"\n")

f1_ gl(2,3); f1
f2_ gl(3,2); f2
f1:f2 # a factor, the ``cross''  f1 x f2
\end{ExampleCode}
\end{Examples}

