| Library: | xplore |
| See also: | isNaN isNumber [] index |
| Macro: | 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. | |
library("xplore")
x=(1~2)|(NaN~4)
replace(x,NaN,3)
Contents of y [1,] 1 2 [2,] 3 4
| Library: | xplore |
| See also: | isNaN isNumber [] index |