\HeaderA{sequence}{Create A Vector of Sequences}{sequence}
\keyword{manip}{sequence}
\begin{Description}\relax
For each element of \code{nvec} the sequence \code{\LinkA{seq\_len}{seq.Rul.len}(nvec[i])}
is created.  These are concatenated and the result returned.
\end{Description}
\begin{Usage}
\begin{verbatim}
sequence(nvec)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{nvec}] a non-negative integer vector each element of which
specifies the end point of a sequence.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Earlier versions of \code{sequence} used to work for 0 or negative inputs as
\code{seq(x) == 1:x}.

Note that \code{sequence <- function(nvec) unlist(lapply(nvec, seq\_len))}
and it mainly exists in reverence to the very early history of \R.
\end{Details}
\begin{SeeAlso}\relax
\code{\LinkA{gl}{gl}}, \code{\LinkA{seq}{seq}}, \code{\LinkA{rep}{rep}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
sequence(c(3,2))# the concatenated sequences 1:3 and 1:2.
#> [1] 1 2 3 1 2
\end{ExampleCode}
\end{Examples}

