eReplace {expandFunctions}R Documentation

Replace values in an R object coerible to a matrix

Description

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.

Usage

eReplace(X, a, b)

Arguments

X

R object coercible to a matrix

a

Value to be replaced

b

Value to replace

Value

X with all a's replaced with b's. a may be NA

See Also

replace, which performs the same operation on vectors, and on which this operation is based.

Examples

A <- matrix(1:6,ncol=2)
A <- eReplace(A,1,NA)
A <- eReplace(A,NA,-9999)
A <- eReplace(A,-9999,0)

[Package expandFunctions version 0.1.0 Index]