ABS inputVector resultVariable

Replaces the contents of the result variable with the absolute value of each element of the input vector.

If any element is a "missing" value (represented by a "." Or "NaN") the result for that position will also be NaN.

COPY -5,5 vec1
ABS vec1 vec2
PRINT vec2

The above program produces the following output:

vec2: (5.0 4.0 3.0 2.0 1.0 0.0 1.0 2.0 3.0 4.0 5.0)