\Header{rep}{Replicate Elements}
\keyword{manip}{rep}
\begin{Description}\relax
\code{rep} replicates the values in \code{x}
according to the values given in \code{times}
and \code{length.out}.

If \code{times} consists of a single integer,
the result consists of the values in
\code{x} repeated this many times.
If \code{times} is a vector of the same length as
\code{x}, the result consists of \code{x[1]}
repeated \code{times[1]} times,
\code{x[2]} repeated \code{times[2]} times and so on.

\code{length.out} may be given in place of \code{times},
in which case \code{x}
is repeated as many times as is necessary
to create a vector of this length.\end{Description}
\begin{Usage}
\begin{verbatim}
rep(x, times, length.out)
\end{verbatim}
\end{Usage}
\begin{SeeAlso}\relax
\code{\Link{seq}}, \code{\Link{sequence}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
rep(1:4,2)
rep(1:4,c(2,2,2,2))
\end{ExampleCode}
\end{Examples}

