\HeaderA{unit.rep}{Replicate Elements of Unit Objects}{unit.rep}
\keyword{dplot}{unit.rep}
\begin{Description}\relax
Replicates the units according to the values given in \code{times} and
\code{length.out}.
\end{Description}
\begin{Usage}
\begin{verbatim}
unit.rep(x, times, length.out)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] An object of class \code{"unit"}. 
\item[\code{times}] integer.  A vector giving the number of times to repeat
each element.  Either of length 1 or \code{length(x)}. 
\item[\code{length.out}] integer.  (Optional.)  The desired length of the
output vector.
\end{ldescription}
\end{Arguments}
\begin{Value}
An object of class \code{"unit"}.
\end{Value}
\begin{Author}\relax
Paul Murrell
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{rep}{rep}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
unit.rep(unit(1:3, "npc"), 3)
unit.rep(unit(1:3, "npc"), 1:3)
unit.rep(unit(1:3, "npc") + unit(1, "inches"), 3)
unit.rep(max(unit(1:3, "npc") + unit(1, "inches")), 3)
unit.rep(max(unit(1:3, "npc") + unit(1, "strwidth", "a"))*4, 3)
unit.rep(unit(1:3, "npc") + unit(1, "strwidth", "a")*4, 3)
\end{ExampleCode}
\end{Examples}

