\Header{replace}{Replace Values in a Vector}
\keyword{manip}{replace}
\begin{Description}\relax
\code{replace} replaces the values in \code{x}
with indexes given in \code{list} by those given in \code{values}.
If necessary, the values in \code{values} are recycled.\end{Description}
\begin{Usage}
\begin{verbatim}
replace(x, list, values)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] vector
\item[\code{list}] an index vector
\item[\code{values}] replacement values
\end{ldescription}
\end{Arguments}
\begin{Value}
A vector with the values replaced.\end{Value}
\begin{Note}\relax
\code{x} is unchanged: remember to assign the result.\end{Note}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.\end{References}

