.BG
.FN numeric
.FN is.numeric
.FN as.numeric
.TL
Numeric Objects
.CS
numeric(length=0)
is.numeric(x)
as.numeric(x)
.AG length
integer giving the length of the returned object.
.AG x
any S object.
.RT
`numeric' returns a simple object of mode `"numeric"', and the length specified.
.PP
`is.numeric' returns `TRUE' if `x' has mode `"numeric"', and
`FALSE' otherwise.
Its behavior is unaffected by any attributes of `x'; for example, `x' could
be a numeric array (in contrast to the behavior of `is.vector').
.PP
`as.numeric' returns `x' if `x' is a simple object of mode `"numeric"', and
otherwise a numeric object of the same length as `x' and with data resulting
from coercing the elements of `x' to mode `"numeric"'.
.PP
When `x' is of mode `"numeric"', the data of `x' may
be stored as integers, or single or double precision
floating point numbers and `storage.mode(x)' will be `"integer"',
`"single"', or `"double"'.
Normally, all numeric constants that appear in expressions
are read with mode `numeric' and storage mode `double'.
This distinction is only relevant when using the
interface to languages like C or Fortran.
.PP
The class of simple objects have no attributes.
In most S expressions it is not
necessary to explicitly ensure that data is of a particular mode.
.PP
Note the difference between coercing to a simple object of mode `"numeric"'
and setting the mode attribute:
.Cs
mode(myobject) <- "numeric"
.Ce
This changes the mode of `myobject' but leaves all other attributes unchanged
(so a matrix stays a matrix, e.g.).  The value of `as.numeric(myobject)'
would have no attributes.  Similarly, `is.numeric' would return `FALSE' for
a matrix of numeric data.
.SA
`storage.mode', `.Fortran'.
.EX
z <- numeric(length(zz)) # double object same length as zz
\&.Fortran("mydsub",as.double(xm))
.KW classes
.WR
