.BG
.FN character
.FN is.character
.FN as.character
.TL
Character Objects
.CS
character(length=0)
is.character(x)
as.character(x)
.AG length
integer giving the length of the returned object.
.AG x
any S object.
.RT
`character' returns a character vector of the
length specified, containing null strings (`""').
.PP
`is.character' returns `TRUE' if `x' has mode
`"character"', and
`FALSE' otherwise.
Its behavior is unaffected by any attributes of `x'; for example, `x' could
be a character array (in contrast to the behavior of `is.vector').
.PP
`as.character' returns `x' if `x' is a simple object of mode `"character"', and
otherwise a character vector of the same length as `x' and with data resulting
from coercing the elements of `x' to mode `"character"'.
.PP
Simple objects have no attributes.
Data elements of objects of
mode `"character"' are character strings.
In most S expressions it is not
necessary to explicitly ensure that data is of a particular mode.
For example,
the function `paste' does not need character arguments; it will coerce data to
character as needed.
.PP
Note the difference between coercing to a simple object of mode `"character"'
and setting the mode attribute:
.Cs
mode(myobject) <- "character"
.Ce
This changes the mode of `myobject' but leaves all other attributes unchanged
(so a matrix stays a matrix, e.g.).
On the other hand, the value of `as.character(myobject)'
would have no attributes.  Similarly, `is.character' would return `FALSE' for
a matrix of character data.
.EX
character(length(zz)) # a character object the same length as zz
as.character(1:10) # character representations of 1,2,...,10
.KW classes
.WR
