sign {math} | R Documentation |
sign returns a vector with the signs of the corresponding
elements of x (the sign of a real number is 1, 0, or -1−1
if the number is positive, zero, or negative, respectively).
Note that sign does not operate on complex vectors.
sign(x);
This is an internal generic primitive function: methods can be defined for it directly or via the Math group generic.