This help topic is for R version 1.5.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/replace.html
replace {base}R Documentation

Replace Values in a Vector

Description

replace replaces the values in x with indexes given in list by those given in values. If necessary, the values in values are recycled.

Usage

replace(x, list, values)

Arguments

x

vector

list

an index vector

values

replacement values

Value

A vector with the values replaced.

Note

x is unchanged: remember to assign the result.


[Package base version 1.5.0 ]