replace
replaces the values in x
with indices given in list
by those given in values
.
If necessary, the values in values
are recycled.
replace(x, list, values)
vector
an index vector
replacement values
A vector with the values replaced.
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.