Absolute Value

DESCRIPTION:

Returns the absolute value of each element of the input.

USAGE:

abs(x) 

REQUIRED ARGUMENTS:

x
object with mode "numeric" or "complex". Missing values ( NAs) are allowed.

VALUE:

object like x, with the absolute value of each data value taken. The moduli of complex numbers are returned, i.e., Mod(x).

CLASSES:

This function will be used as the default method for classes that do not inherit a specific method for the function or for the Math group of functions. The result will retain the class and the attributes. If this behavior is not appropriate, the designer of the class should provide a method for the function or for the Math group

DETAILS:

This is a member of the Math group of generic functions.

SEE ALSO:

.

EXAMPLES:

abs(rnorm(10)) # vector of length 10 
abs(matrix(rnorm(10), 2)) # 2 by 5 matrix