.BG
.FN integer
.FN is.integer
.FN as.integer
.TL
Integer Objects
.CS
integer(length=0)
is.integer(x)
as.integer(x)
.AG length
integer giving the length of the returned object.
.AG x
any S object.
.RT
`integer' returns a simple object of storage mode `"integer"', and the length specified.
.PP
`is.integer' returns `TRUE' if `x' is a simple object of storage mode `"integer"', and
`FALSE' otherwise.
.PP
`as.integer' returns `x' if `x' is a simple object of storage mode `"integer"', and
otherwise an integer object of the same length as `x' and with data resulting
from coercing the elements of `x' to storage mode `"integer"'.
.PP
In most S expressions it is not
necessary to explicitly ensure that data is of a particular storage
mode.
For example,
a numeric subscript vector need not be integer;
it will be coerced to
integer as needed.
When testing for data suitable for arithmetic, for example, it is better to
use
`is.numeric(x)',
which will return `TRUE' for any numeric object.
.PP
Note the difference between coercing to a simple object of storage mode `"integer"'
and setting the storage mode attribute:
.Cs
storage.mode(myobject) <- "integer"
.Ce
This changes the storage mode of `myobject' but leaves all other attributes unchanged
(so a matrix stays a matrix, e.g.).  The value of `as.integer(myobject)'
would have no attributes.
.SA
`\&.Fortran', `.C'.
.EX
z <- integer(length(zz)) # integer object same length as zz
\&.Fortran("mysub",as.integer(xm))
.KW classes
.WR
