Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: xplore
See also: isNaN isNumber [] index

Quantlet: replace
Description: Replaces values by other values.

Usage: y = replace(x,w,b)
Input:
x array, string or numeric.
w scalar or vector, the value to be replaced.
b scalar, the value to replace.
Output:
y array, numeric, matrix x after all values w are replaced by b.

Example:
library("xplore")
x=(1~2)|(NaN~4)
replace(x,NaN,3)

Result:
Contents of y
[1,]        1        2
[2,]        3        4



Author: M. Mueller, 19970702
(C) MD*TECH Method and Data Technologies, 05.02.2006