.BG
.FN vector
.FN is.vector
.FN as.vector
.TL
Vectors (Simple Objects)
.CS
vector(mode="logical", length=0)
is.vector(x, mode="any")
as.vector(x, mode="any")
.AG mode
character string giving the mode wanted.
.AG length
integer value giving the length wanted.
.AG x
any S object.
.RT
`vector' returns a simple object of the desired mode and length.
.PP
`is.vector' returns `TRUE' if `x' is a simple object of the mode specified, and
`FALSE' otherwise.
If the mode is `"any"', any simple object will match.
.PP
`as.vector' returns `x' if `x' is a simple object of the mode specified, and
otherwise an object of the same length as `x' and with data resulting
from coercing the elements of `x' to that mode.
If the mode is `"any"', the effect is simply to remove any attributes of
`x' in the result.
.PP
Note the difference between coercing to a simple object
and setting the `mode' attribute:
.Cs
mode(x) <- mode(y)
.Ce
This changes the mode of `x' but leaves all other attributes unchanged
(so a matrix stays a matrix).  The value of `as.vector(x,mode(y))'
would have no attributes.  Similarly, `is.vector' would return `FALSE' for
a matrix.
.EX
vector("list", 10) # list of length 10, initialized to null elements.
as.vector(x,mode(y)) # make a simple object of same mode as y
.KW classes
.WR
