mode(x) mode(x) <- value storage.mode(x) storage.mode(x) <- value
NA
s) are allowed.
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.
value
, interpreted as
a character string.
Attributes of
x
are unchanged.
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 include:
"list"
,
"function"
,
"graphics"
,
"expression"
,
"comment expression"
,
"comment"
,
"name"
,
"call"
,
"call(...)"
,
"frame"
,
"<-"
,
"<<-"
,
"missing"
,
"internal"
,
"repeat"
,
"while"
,
"for"
,
"{"
,
"("
.
"return"
,
"break"
,
"next"
,
"if"
,
"structure"
,
"unknown"
.
Numerous other modes are used internally but should not normally be encountered.
The
mode
function has nothing to do with the statistical concept
of the mode of a distribution.
mode(x) # get the mode of x mode(x) <- "complex" # change mode to complex storage.mode(x) <- "single"