The R Project SVN R

Rev

Rev 56186 | Rev 85065 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
42333 ripley 1
% File src/library/base/man/replace.Rd
2
% Part of the R package, http://www.R-project.org
59039 ripley 3
% Copyright 1995-2007 R Core Team
42333 ripley 4
% Distributed under GPL 2 or later
5
 
2 r 6
\name{replace}
7
\title{Replace Values in a Vector}
8
\usage{
9
replace(x, list, values)
10
}
56186 murdoch 11
\alias{replace}
2 r 12
\description{
13
\code{replace} replaces the values in \code{x}
50263 ripley 14
with indices given in \code{list} by those given in \code{values}.
2 r 15
If necessary, the values in \code{values} are recycled.
16
}
15518 ripley 17
\arguments{
18
  \item{x}{vector}
19
  \item{list}{an index vector}
20
  \item{values}{replacement values}
21
}
22
\value{
23
  A vector with the values replaced.
24
}
24300 ripley 25
\references{
26
  Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
27
  \emph{The New S Language}.
47262 ripley 28
  Wadsworth & Brooks/Cole.
24300 ripley 29
}
15518 ripley 30
\note{
31
  \code{x} is unchanged: remember to assign the result.
32
}
286 maechler 33
\keyword{manip}