eReplace: Replace values in an R object coerible to a matrix

Description Usage Arguments Value See Also Examples

View source: R/expandFunctions.R

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

1
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

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

expandFunctions documentation built on May 2, 2019, 9:15 a.m.