| replace {base} | R Documentation |
Replace Values in a Vector
Description
replace replaces the values in x
with indices given in list by those given in values.
If necessary, the values in values are recycled.
Usage
replace(x, list, values)
Arguments
x |
a vector. |
list |
an index vector. |
values |
replacement values. |
Value
A vector with the values replaced.
Note
x is unchanged: remember to assign the result.
References
Becker RA, Chambers JM, Wilks AR (1988). The New S Language. Chapman and Hall/CRC, London.
[Package base version 4.6.0 Index]