eReplace {expandFunctions} | R Documentation |
Replace values in an R object coerible to a matrix. It is useful for replacing NA with other values, etc., such as with padding values.
eReplace(X, a, b)
X |
R object coercible to a matrix |
a |
Value to be replaced |
b |
Value to replace |
X with all a's replaced with b's. a may be NA
replace
, which performs the same
operation on vectors, and on which this operation is based.
A <- matrix(1:6,ncol=2) A <- eReplace(A,1,NA) A <- eReplace(A,NA,-9999) A <- eReplace(A,-9999,0)