Data Mode of the Values in a Vector

DESCRIPTION:
Returns or changes the type of the S-PLUS object.

USAGE:
mode(x)
mode(x) <- value

storage.mode(x) storage.mode(x) <- value


REQUIRED ARGUMENTS:
x:
any object. Missing values (NAs) are allowed.

VALUE:
mode returns a character string which is the mode of x, for example "null", "logical", "numeric", "list", or any of a number of modes used by the S-PLUS language.

storage.mode returns one of "integer", "double" or "single" if x is numeric; it returns the mode of x otherwise.


SIDE EFFECTS:
When used on the left of an assignment, the mode of the object is changed to value, interpreted as a character string. Attributes of x are unchanged.

DETAILS:
These are generic functions, you may create methods for these functions for specific classes of objects.

storage.mode is relevant only when calling .Fortran or .C with numeric data. When mode(x) is "numeric", the data of x may be stored as integers, or as single-precision or double-precision floating point numbers: storage.mode(x) will be "integer", "single" or "double" correspondingly.

The atomic modes are: "logical", "numeric", "complex", "character" and "null". The other modes are: "list", "function", "graphics", "expression", "comment.expression", "name", "call", "call(...)", "frame", "<-", "<<-", "missing", "internal", "repeat", "while", "for", "{", "return", "break", "next", "if", "unknown".


NOTE:
The mode function has nothing to do with the statistical concept of the mode of a distribution.

SEE ALSO:
attributes , .Fortran , double , single , integer , vector , complex , character , numeric , is.recursive .

EXAMPLES:
mode(x)  # get the mode of x
mode(x) <- "complex"  # change mode to complex

storage.mode(x) <- "single"